src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java | ●●●●● patch | view | raw | blame | history |
src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java
@@ -1,17 +1,26 @@ package com.xcong.excoin.modules.documentary.controller; import javax.annotation.Resource; import javax.validation.Valid; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.documentary.dto.UpdateDocumentaryOrderSetDto; import com.xcong.excoin.modules.documentary.dto.UpdateTradeSetInfoDto; import com.xcong.excoin.modules.documentary.service.DocumentaryService; import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderSetInfoVo; import com.xcong.excoin.modules.documentary.vo.MyFollowOrderVo; import com.xcong.excoin.modules.documentary.vo.TradeSetInfoVo; import com.xcong.excoin.modules.documentary.vo.TraderStatusVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; @@ -44,5 +53,27 @@ public Result beTrader() { return documentaryService.beTrader(); } /** * 交易员设置--进入编辑 */ @ApiOperation(value="交易员设置--进入编辑", notes="交易员设置--进入编辑") @ApiResponses({@ApiResponse( code = 200, message = "success", response = TradeSetInfoVo.class)}) @ApiImplicitParams({ @ApiImplicitParam(name = "tradeId", value = "交易员ID", required = true, dataType = "String", paramType="query") }) @GetMapping(value = "/getTradeSetInfo") public Result getTradeSetInfo(String tradeId) { return documentaryService.getTradeSetInfo(tradeId); } /** * 交易员设置--更新设置 */ @ApiOperation(value="交易员设置--更新设置", notes="交易员设置--更新设置") @PostMapping(value = "/updateTradeSetInfo") public Result updateTradeSetInfo(@RequestBody @Valid UpdateTradeSetInfoDto updateTradeSetInfoDto) { return documentaryService.updateTradeSetInfo(updateTradeSetInfoDto); } } src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java
New file @@ -0,0 +1,28 @@ package com.xcong.excoin.modules.documentary.dto; import javax.validation.constraints.NotNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "UpdateTradeSetInfoDto", description = "参数接受类") public class UpdateTradeSetInfoDto { @NotNull @ApiModelProperty(value = "交易员ID") private Long tradeId; @NotNull @ApiModelProperty("头像") private String avatar; @NotNull @ApiModelProperty("名称") private String nickname; @NotNull @ApiModelProperty("是否开启带单 1是2否") private int isOpen; @NotNull @ApiModelProperty("宣言") private String declaration; } src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
@@ -12,6 +12,7 @@ import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto; import com.xcong.excoin.modules.documentary.dto.MyFollowTraderInfoDto; import com.xcong.excoin.modules.documentary.dto.UpdateDocumentaryOrderSetDto; import com.xcong.excoin.modules.documentary.dto.UpdateTradeSetInfoDto; import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity; public interface DocumentaryService extends IService<FollowTraderProfitInfoEntity> { @@ -48,4 +49,8 @@ public Result beTraderStatus(); public Result getTradeSetInfo(String tradeId); public Result updateTradeSetInfo(@Valid UpdateTradeSetInfoDto updateTradeSetInfoDto); } src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -37,6 +37,7 @@ import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto; import com.xcong.excoin.modules.documentary.dto.MyFollowTraderInfoDto; import com.xcong.excoin.modules.documentary.dto.UpdateDocumentaryOrderSetDto; import com.xcong.excoin.modules.documentary.dto.UpdateTradeSetInfoDto; import com.xcong.excoin.modules.documentary.entity.FollowFollowerOrderRelationEntity; import com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity; import com.xcong.excoin.modules.documentary.entity.FollowFollowerSettingEntity; @@ -52,6 +53,7 @@ import com.xcong.excoin.modules.documentary.vo.MemberIsTradeVo; import com.xcong.excoin.modules.documentary.vo.MyFollowOrderVo; import com.xcong.excoin.modules.documentary.vo.MyFollowTraderInfoVo; import com.xcong.excoin.modules.documentary.vo.TradeSetInfoVo; import com.xcong.excoin.modules.documentary.vo.TraderStatusVo; import com.xcong.excoin.modules.member.dao.MemberDao; import com.xcong.excoin.modules.member.dao.MemberLevelRateDao; @@ -643,6 +645,42 @@ } return Result.ok(traderStatusVo); } @Override public Result getTradeSetInfo(String tradeId) { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoDao.selectById(tradeId); TradeSetInfoVo tradeSetInfoVo = new TradeSetInfoVo(); String avatar = followTraderInfoEntity.getAvatar(); tradeSetInfoVo.setAvatar(avatar); String nickname = followTraderInfoEntity.getNickname(); tradeSetInfoVo.setNickname(nickname); String declaration = followTraderInfoEntity.getDeclaration(); tradeSetInfoVo.setDeclaration(declaration); Integer isOpen = followTraderInfoEntity.getIsOpen(); tradeSetInfoVo.setIsOpen(isOpen); return Result.ok(tradeSetInfoVo); } @Override public Result updateTradeSetInfo(@Valid UpdateTradeSetInfoDto updateTradeSetInfoDto) { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); String avatar = updateTradeSetInfoDto.getAvatar(); String nickname = updateTradeSetInfoDto.getNickname(); String declaration = updateTradeSetInfoDto.getDeclaration(); int isOpen = updateTradeSetInfoDto.getIsOpen(); FollowTraderInfoEntity followTraderInfoEntity = new FollowTraderInfoEntity(); followTraderInfoEntity.setAvatar(avatar); followTraderInfoEntity.setNickname(nickname); followTraderInfoEntity.setDeclaration(declaration); followTraderInfoEntity.setIsOpen(isOpen); followTraderInfoDao.updateById(followTraderInfoEntity); return Result.ok(MessageSourceUtils.getString("member_service_0024")); } src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java
New file @@ -0,0 +1,28 @@ package com.xcong.excoin.modules.documentary.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "TradeSetInfoVo", description = "返回类") public class TradeSetInfoVo { @ApiModelProperty(value = "交易员ID") private Long tradeId; @ApiModelProperty("头像") private String avatar; @ApiModelProperty("名称") private String nickname; @ApiModelProperty("是否开启带单 1是2否") private int isOpen; @ApiModelProperty("宣言") private String declaration; }