情人节cp活动-接口swagger
This commit is contained in:
@@ -9,7 +9,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* admin
|
||||
@@ -21,7 +20,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@EnableFeignClients(basePackages = "com.accompany")
|
||||
@MapperScan({"com.accompany.*.mapper","com.accompany.*.mybatismapper","com.xuanyin.*.mapper"})
|
||||
@EnableSwagger2
|
||||
@ServletComponentScan(value = {"com.accompany", "com.xuanyin"})
|
||||
@SpringBootConfiguration
|
||||
public class AdminApplication {
|
||||
|
@@ -9,7 +9,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* admin
|
||||
@@ -21,7 +20,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@EnableFeignClients(basePackages = "com.accompany")
|
||||
@MapperScan({"com.accompany.*.mapper","com.accompany.*.mybatismapper","com.xuanyin.*.mapper"})
|
||||
@EnableSwagger2
|
||||
@ServletComponentScan(value = {"com.accompany", "com.xuanyin"})
|
||||
@SpringBootConfiguration
|
||||
public class FlowTeamAdminApplication {
|
||||
|
@@ -13,6 +13,7 @@ import springfox.documentation.schema.ModelRef;
|
||||
import springfox.documentation.service.Parameter;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -21,6 +22,7 @@ import java.util.List;
|
||||
* @author linuxea
|
||||
* @date 2019/8/29 14:29
|
||||
*/
|
||||
@EnableSwagger2
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class SwaggerAutoConfiguration {
|
||||
|
@@ -0,0 +1,57 @@
|
||||
package com.accompany.business.service.activities;
|
||||
|
||||
import com.accompany.business.vo.activities.valentineCp.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ActValentineCpService {
|
||||
|
||||
@Autowired
|
||||
private RedissonClient redissonClient;
|
||||
|
||||
public ValentineCpKeepsakeConfigVo getKeepsakeConfig(Long uid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getMyCpOffset(Long uid) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public List<ValentineCpLevelRewardVo> listMyCpLevelReward(Long uid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<ValentineCpRelationVo> listMyCpRelation(Long uid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void confirmCpRelation(Long uid, Long inviterUid) {
|
||||
}
|
||||
|
||||
public ValentineCpBasePropItemVo buy(Long uid, Integer id, Integer num) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public ValentineCpPropConfigVo getPropConfig(Long uid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<ValentineCpRecordVo> listRecord(Long uid, Byte tab) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ValentineCpRankVo getRank(Long uid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void log(Long uid, String event) {
|
||||
log.info("{} {}", uid, event);
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class ValentineCpBasePropItemVo {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Integer id;
|
||||
@ApiModelProperty(value = "道具名", example = "名牌 * 1天")
|
||||
private String name;
|
||||
@ApiModelProperty("icon")
|
||||
private String icon;
|
||||
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class ValentineCpKeepsakeConfigVo {
|
||||
|
||||
@ApiModelProperty("开始时间时间戳")
|
||||
private Date startTime;
|
||||
@ApiModelProperty("结束时间时间戳")
|
||||
private Date endTime;
|
||||
@ApiModelProperty("信物")
|
||||
private ValentineCpPropItemVo keepsake;
|
||||
@ApiModelProperty("背包信物数量")
|
||||
private Long keepsakeNum;
|
||||
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class ValentineCpLevelRewardVo {
|
||||
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@ApiModelProperty("昵称")
|
||||
private String nick;
|
||||
@ApiModelProperty("等级(初始=0,一见钟情=1,情窦初开=2,心心相印=3,缘定今生=4)")
|
||||
private Long level;
|
||||
@ApiModelProperty(value = "等级描述中文", example = "一见钟情")
|
||||
private String levelDesc;
|
||||
@ApiModelProperty(value = "奖励描述", example = "座驾1天 * 1组")
|
||||
private String rewardDesc;
|
||||
@ApiModelProperty(value = "时间", example = "MM.dd hh:mm")
|
||||
private String dateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class ValentineCpPropConfigVo {
|
||||
|
||||
@ApiModelProperty("信物页签(兑换=1,抽奖=2)")
|
||||
private Map<Byte, List<ValentineCpPropItemVo>> propTabs;
|
||||
@ApiModelProperty("情签数")
|
||||
private Long cpCurrency;
|
||||
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(parent = ValentineCpBasePropItemVo.class)
|
||||
public class ValentineCpPropItemVo extends ValentineCpBasePropItemVo{
|
||||
|
||||
@ApiModelProperty("类型(礼券=1,铭牌=2,资料卡=3,头饰=4,座驾=5,靓号=6)")
|
||||
private Byte type;
|
||||
@ApiModelProperty(value = "类型描述中文", example = "礼券")
|
||||
private Byte typeDesc;
|
||||
@ApiModelProperty("价格")
|
||||
private Integer price;
|
||||
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author guojicong
|
||||
* @description
|
||||
* @date 2022-07-26
|
||||
*/
|
||||
@ApiModel
|
||||
@Data
|
||||
public class ValentineCpRankItemVo {
|
||||
@ApiModelProperty("排名(未上榜=0)")
|
||||
private Integer ranking;
|
||||
@ApiModelProperty("情缘值")
|
||||
private Double cpValue;
|
||||
|
||||
@ApiModelProperty("邀请者")
|
||||
private Long inviterUid;
|
||||
@ApiModelProperty("erban号")
|
||||
private Long inviterErbanNo;
|
||||
@ApiModelProperty("昵称")
|
||||
private String inviterNick;
|
||||
@ApiModelProperty("头像")
|
||||
private String inviterAvatar;
|
||||
|
||||
@ApiModelProperty("受邀者")
|
||||
private Long inviteeUid;
|
||||
@ApiModelProperty("erban号")
|
||||
private Long inviteeErbanNo;
|
||||
@ApiModelProperty("昵称")
|
||||
private String inviteeNick;
|
||||
@ApiModelProperty("头像")
|
||||
private String inviteeAvatar;
|
||||
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class ValentineCpRankVo {
|
||||
|
||||
@ApiModelProperty("前20排名")
|
||||
private List<ValentineCpRankItemVo> rankList;
|
||||
@ApiModelProperty("自己的排名")
|
||||
private ValentineCpRankItemVo meRank;
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class ValentineCpRecordVo {
|
||||
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@ApiModelProperty("消耗情签")
|
||||
private Integer cost;
|
||||
@ApiModelProperty(value = "奖励中文", example = "幸运靓号 * 1组")
|
||||
private String rewardDesc;
|
||||
@ApiModelProperty("奖励天数")
|
||||
private Integer rewardDays;
|
||||
@ApiModelProperty(value = "时间", example = "MM.dd hh:mm")
|
||||
private String dateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.accompany.business.vo.activities.valentineCp;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class ValentineCpRelationVo {
|
||||
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@ApiModelProperty("昵称")
|
||||
private String nick;
|
||||
@ApiModelProperty("情缘值")
|
||||
private Long cpValue;
|
||||
@ApiModelProperty("状态(0待通过,1可通过,2已缔结)")
|
||||
private Byte status;
|
||||
|
||||
}
|
@@ -13,14 +13,12 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
@ComponentScan({"com.accompany","com.xuanyin"})
|
||||
@ServletComponentScan(value = {"com.accompany", "com.xuanyin"})
|
||||
@EnableSwagger2
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@EnableScheduling
|
||||
@EnableFeignClients(basePackages = "com.accompany")
|
||||
|
@@ -0,0 +1,138 @@
|
||||
package com.accompany.business.controller.activities;
|
||||
|
||||
import com.accompany.business.common.BaseController;
|
||||
import com.accompany.business.service.activities.ActValentineCpService;
|
||||
import com.accompany.business.vo.activities.valentineCp.*;
|
||||
import com.accompany.common.annotation.Authorization;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "2023情人节cp活动")
|
||||
@RestController
|
||||
@RequestMapping("/act/valentineCp")
|
||||
public class ActValentineCpController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ActValentineCpService service;
|
||||
|
||||
@ApiOperation("获取信物配置")
|
||||
@GetMapping("/getKeepsakeConfig")
|
||||
@Authorization
|
||||
public BusiResult<ValentineCpKeepsakeConfigVo> getKeepsakeConfig(HttpServletRequest request){
|
||||
Long uid = getUid(request);
|
||||
ValentineCpKeepsakeConfigVo configVo = service.getKeepsakeConfig(uid);
|
||||
return new BusiResult<>(configVo);
|
||||
}
|
||||
|
||||
@ApiOperation("我的cp未读数")
|
||||
@GetMapping("/cpOffset")
|
||||
@Authorization
|
||||
public BusiResult<Integer> getMyCpOffset(HttpServletRequest request){
|
||||
Long uid = getUid(request);
|
||||
Integer num = service.getMyCpOffset(uid);
|
||||
return new BusiResult<>(num);
|
||||
}
|
||||
|
||||
@ApiOperation("我的cp列表")
|
||||
@GetMapping("/cpList")
|
||||
@Authorization
|
||||
public BusiResult<List<ValentineCpRelationVo>> listMyCp(HttpServletRequest request){
|
||||
Long uid = getUid(request);
|
||||
List<ValentineCpRelationVo> list = service.listMyCpRelation(uid);
|
||||
return new BusiResult<>(list);
|
||||
}
|
||||
|
||||
@ApiOperation("通过cp缔结")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="inviterUid", value="邀请者uid", required=true)
|
||||
})
|
||||
@GetMapping("/confirmCp")
|
||||
@Authorization
|
||||
public BusiResult<Void> confirmCp(HttpServletRequest request, Long inviterUid){
|
||||
if (null == inviterUid){
|
||||
throw new ServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Long uid = getUid(request);
|
||||
service.confirmCpRelation(uid, inviterUid);
|
||||
return new BusiResult<>(BusiStatus.SUCCESS);
|
||||
}
|
||||
|
||||
@ApiOperation("我的cp奖励记录")
|
||||
@GetMapping("/listCpRewardRecord")
|
||||
@Authorization
|
||||
public BusiResult<List<ValentineCpLevelRewardVo>> listMyCpLevelReward(HttpServletRequest request){
|
||||
Long uid = getUid(request);
|
||||
List<ValentineCpLevelRewardVo> list = service.listMyCpLevelReward(uid);
|
||||
return new BusiResult<>(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取兑换/抽奖配置")
|
||||
@GetMapping("/getPropItemConfig")
|
||||
@Authorization
|
||||
public BusiResult<ValentineCpPropConfigVo> getPropConfig(HttpServletRequest request){
|
||||
Long uid = getUid(request);
|
||||
ValentineCpPropConfigVo configVo = service.getPropConfig(uid);
|
||||
return new BusiResult<>(configVo);
|
||||
}
|
||||
|
||||
@ApiOperation("购买信物、兑换、抽奖")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="id", value="道具id,在config获取", required=true),
|
||||
@ApiImplicitParam(name="num", value="数量", required=true)
|
||||
})
|
||||
@PostMapping("/buy")
|
||||
@Authorization
|
||||
public BusiResult<ValentineCpBasePropItemVo> buy(HttpServletRequest request, Integer id, Integer num){
|
||||
Long uid = getUid(request);
|
||||
ValentineCpBasePropItemVo result = service.buy(uid, id, num);
|
||||
return new BusiResult<>(result);
|
||||
}
|
||||
|
||||
@ApiOperation("获取兑换/抽奖记录")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="tab", value="兑换=1, 抽奖=2", required=true)
|
||||
})
|
||||
@GetMapping("/listRecord")
|
||||
@Authorization
|
||||
public BusiResult<List<ValentineCpRecordVo>> listRecord(HttpServletRequest request, Byte tab){
|
||||
Long uid = getUid(request);
|
||||
List<ValentineCpRecordVo> recordVos = service.listRecord(uid, tab);
|
||||
return new BusiResult<>(recordVos);
|
||||
}
|
||||
|
||||
@ApiOperation("获取cp情缘排行榜")
|
||||
@GetMapping("/getRank")
|
||||
@Authorization
|
||||
public BusiResult<ValentineCpRankVo> getRank(HttpServletRequest request){
|
||||
Long uid = getUid(request);
|
||||
ValentineCpRankVo rankVo = service.getRank(uid);
|
||||
return new BusiResult<>(rankVo);
|
||||
}
|
||||
|
||||
@ApiOperation("埋点")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="event", value="回传四个事件 (去充值=pay_show, 活动规则=rule_click, 排行榜奖励=list_click, 跳转玩家主页=pages_click)", required=true)
|
||||
})
|
||||
@PostMapping("/log")
|
||||
@Authorization
|
||||
public BusiResult<Void> log(HttpServletRequest request, String event){
|
||||
if (!StringUtils.hasText(event)){
|
||||
throw new ServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Long uid = getUid(request);
|
||||
service.log(uid, event);
|
||||
return new BusiResult<>(BusiStatus.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
@@ -8,8 +8,7 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;;
|
||||
|
||||
@SpringBootApplication
|
||||
@ComponentScan("com.accompany")
|
||||
@@ -18,7 +17,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@EnableFeignClients(basePackages = "com.accompany")
|
||||
@MapperScan({"com.accompany.*.mapper","com.accompany.*.mybatismapper"})
|
||||
@EnableSwagger2
|
||||
@SpringBootConfiguration
|
||||
public class OAuth2Application {
|
||||
public static void main(String[] args) {
|
||||
|
@@ -8,7 +8,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* @author PaperCut
|
||||
@@ -20,7 +19,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@EnableFeignClients(basePackages = "com.accompany")
|
||||
@MapperScan({"com.accompany.*.mapper","com.accompany.*.mybatismapper", "com.xuanyin.*.mapper"})
|
||||
@EnableSwagger2
|
||||
@SpringBootConfiguration
|
||||
public class JobApplication {
|
||||
|
||||
|
@@ -12,14 +12,12 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
@ComponentScan({"com.accompany", "com.xuanyin"})
|
||||
@ServletComponentScan
|
||||
@EnableSwagger2
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@EnableFeignClients(basePackages = "com.accompany")
|
||||
@MapperScan({"com.accompany.*.mybatismapper","com.accompany.*.mapper", "com.xuanyin.*.mapper"})
|
||||
|
Reference in New Issue
Block a user