From 74d3712317f0596e5d424a00239c7c3742db78a5 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 04 Aug 2020 16:16:00 +0800
Subject: [PATCH] Merge branch 'follow' of https://gitee.com/chonggaoxiao/new_excoin into follow
---
src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java | 28 +++++++++
src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java | 31 ++++++++++
src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java | 28 +++++++++
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java | 5 +
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java | 38 ++++++++++++
5 files changed, 130 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java b/src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java
index 43d8ed8..4fecaae 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java
+++ b/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);
+ }
}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java b/src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java
new file mode 100644
index 0000000..673cf70
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java
@@ -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;
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java b/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
index b9fca80..9c9d57a 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
+++ b/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);
+
}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
index 5e5781b..23d2a70 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
+++ b/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"));
+ }
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java b/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java
new file mode 100644
index 0000000..8d3722e
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java
@@ -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;
+
+
+
+}
--
Gitblit v1.9.1