src/main/java/com/xcong/excoin/configurations/security/WebSecurityConfig.java
@@ -53,6 +53,8 @@ .antMatchers("/api/member/getAppVersionInfo").permitAll() .antMatchers("/api/orderCoin/searchSymbolResultList").permitAll() .antMatchers("/api/orderCoin/findCollect").permitAll() .antMatchers("/api/orderCoin/deal/list").permitAll() .antMatchers("/api/helpCenter/**").permitAll() .antMatchers("/trade/**").permitAll() .anyRequest().authenticated() .and().apply(securityConfiguereAdapter()); src/main/java/com/xcong/excoin/modules/blackchain/service/EthUsdtContract.java
@@ -301,7 +301,6 @@ public TransferEventResponse apply(Log log) { EventValuesWithLog eventValues = extractEventParametersWithLog(TRANSFER_EVENT, log); TransferEventResponse typedResponse = new TransferEventResponse(); System.out.println(eventValues); if(eventValues!=null){ typedResponse.log = log; typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue(); src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java
@@ -9,11 +9,7 @@ import com.xcong.excoin.modules.coin.entity.OrderCoinsEntity; import com.xcong.excoin.modules.symbols.constants.SymbolsConstats; import org.springframework.validation.annotation.Validated; 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 org.springframework.web.bind.annotation.*; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.coin.parameter.dto.CancelEntrustWalletCoinOrderDto; @@ -39,6 +35,7 @@ @Api(value = "币币交易接口", tags = "币币交易接口") @RestController @RequestMapping(value = "/api/orderCoin") @CrossOrigin("*") public class OrderCoinController { @Resource @@ -178,4 +175,14 @@ return orderCoinService.searchSymbolResultList(); } /** * 获取币币交易历史订单信息 * @return */ @ApiOperation(value = "获取币币交易历史订单信息", notes = "获取币币交易历史订单信息") @ApiResponses({@ApiResponse( code = 200, message = "success", response = OrderWalletCoinDealVo.class)}) @GetMapping(value="/deal/list") public Result findAllWalletCoinOrder() { return orderCoinService.findAllWalletCoinOrder(); } } src/main/java/com/xcong/excoin/modules/coin/dao/OrderCoinDealDao.java
@@ -17,6 +17,7 @@ List<OrderCoinsDealEntity> selectAllWalletCoinOrder(@Param("memberId")Long memberId); List<OrderCoinsDealEntity> selectAllWalletCoinOrderBySymbol(@Param("memberId")Long memberId,@Param("symbol")String symbol); List<OrderCoinsDealEntity> selectAllCoinDealsOrderBySymbol(@Param("symbol")String symbol); OrderCoinsDealEntity selectWalletCoinOrder(@Param("memberId")Long memberId,@Param("orderId")Long orderId); src/main/java/com/xcong/excoin/modules/coin/service/OrderCoinService.java
@@ -36,6 +36,7 @@ public Result cancelEntrustWalletCoinOrder(String orderId); public Result findAllWalletCoinOrder(FindAllWalletCoinOrderDto findAllWalletCoinOrderDto); public Result findAllWalletCoinOrder(); public Result findWalletCoinOrder(Long orderId); src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java
@@ -8,6 +8,7 @@ import javax.annotation.Resource; import com.alibaba.fastjson.JSONObject; import com.xcong.excoin.common.enumerates.CoinTypeEnum; import com.xcong.excoin.modules.blackchain.service.RocService; import com.xcong.excoin.modules.coin.mapper.OrderCoinsDealMapper; import com.xcong.excoin.modules.member.dao.MemberDao; @@ -713,6 +714,12 @@ } @Override public Result findAllWalletCoinOrder() { List<OrderCoinsDealEntity> orderCoinsDealEntities = orderCoinDealDao.selectAllCoinDealsOrderBySymbol(CoinTypeEnum.ROC.toString()); return Result.ok(orderCoinsDealEntities); } @Override public Result findWalletCoinOrder(Long orderId) { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); src/main/java/com/xcong/excoin/modules/helpCenter/controller/HelpCenterController.java
New file @@ -0,0 +1,120 @@ package com.xcong.excoin.modules.helpCenter.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.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.helpCenter.dto.ImportantNoticePageDto; import com.xcong.excoin.modules.helpCenter.dto.NewNoticePageDto; import com.xcong.excoin.modules.helpCenter.dto.NewNoticeTypePageDto; import com.xcong.excoin.modules.helpCenter.dto.NoticePageDto; import com.xcong.excoin.modules.helpCenter.service.HelpCenterService; import com.xcong.excoin.modules.helpCenter.vo.ImportantNoticeVo; import com.xcong.excoin.modules.helpCenter.vo.NewNoticeInfoVo; import com.xcong.excoin.modules.helpCenter.vo.NewNoticeTypeInfoVo; import com.xcong.excoin.modules.helpCenter.vo.NoticeInfoVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; @RestController @Slf4j @RequestMapping(value = "/api/helpCenter") @Api(value = "HelpCenterController", tags = "帮助中心") public class HelpCenterController { @Resource HelpCenterService helpCenterService; /** * 公告类别列表 */ @ApiOperation(value="公告类别列表", notes="公告类别列表") @ApiResponses({@ApiResponse( code = 200, message = "success", response = NewNoticeTypeInfoVo.class)}) @PostMapping(value = "/getNewNoticeTypeList") public Result getNewNoticeTypeList(@RequestBody @Valid NewNoticeTypePageDto newNoticeTypePageDto) { return helpCenterService.getNewNoticeTypeList(newNoticeTypePageDto); } /** * 公告列表 */ @ApiOperation(value="公告列表", notes="公告列表") @ApiResponses({@ApiResponse( code = 200, message = "success", response = NewNoticeInfoVo.class)}) @PostMapping(value = "/getNoticeList") public Result getNoticeList(@RequestBody @Valid NoticePageDto noticePageDto) { return helpCenterService.getNoticeList(noticePageDto); } /** * 关于我们 */ @ApiOperation(value="关于我们", notes="关于我们") @ApiResponses({@ApiResponse( code = 200, message = "success", response = NoticeInfoVo.class)}) @GetMapping(value = "/getAboutUs") public Result getAboutUs() { return helpCenterService.getAboutUs(); } /** * 用户协议 */ @ApiOperation(value="用户协议", notes="用户协议") @ApiResponses({@ApiResponse( code = 200, message = "success", response = NoticeInfoVo.class)}) @GetMapping(value = "/getUserAgreement") public Result getUserAgreement() { return helpCenterService.getUserAgreement(); } /** * 首页轮播公告 */ @ApiOperation(value="首页轮播公告", notes="首页轮播公告") @ApiResponses({@ApiResponse( code = 200, message = "success", response = NewNoticeInfoVo.class)}) @PostMapping(value = "/getFristNewNoticeList") public Result getFristNewNoticeList(@RequestBody @Valid NewNoticePageDto newNoticePageDto) { return helpCenterService.getFristNewNoticeList(newNoticePageDto); } /** * 最新公告 */ @ApiOperation(value="最新公告", notes="最新公告") @ApiResponses({@ApiResponse( code = 200, message = "success", response = NewNoticeInfoVo.class)}) @PostMapping(value = "/getNewNoticeList") public Result getNewNoticeList(@RequestBody @Valid NewNoticePageDto newNoticePageDto) { return helpCenterService.getNewNoticeList(newNoticePageDto); } /** * 重要公告 */ @ApiOperation(value="重要公告", notes="重要公告") @ApiResponses({@ApiResponse( code = 200, message = "success", response = ImportantNoticeVo.class)}) @PostMapping(value = "/getImportantNoticeList") public Result getImportantNoticeList(@RequestBody @Valid ImportantNoticePageDto importantNoticePageDto) { return helpCenterService.getImportantNoticeList(importantNoticePageDto); } /** * 公告详情 */ @ApiOperation(value="公告详情", notes="公告详情") @ApiResponses({@ApiResponse( code = 200, message = "success", response = NoticeInfoVo.class)}) @GetMapping(value = "/getNoticeInfo") public Result getNoticeInfo(@ApiParam(name = "Id", value = "ID", example = "1") @RequestParam(value = "Id", required = false) long Id) { return helpCenterService.getNoticeInfo(Id); } } src/main/java/com/xcong/excoin/modules/helpCenter/dao/HelpCenterArticleDao.java
New file @@ -0,0 +1,8 @@ package com.xcong.excoin.modules.helpCenter.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.xcong.excoin.modules.helpCenter.entity.HelpCenterArticleEntity; public interface HelpCenterArticleDao extends BaseMapper<HelpCenterArticleEntity> { } src/main/java/com/xcong/excoin/modules/helpCenter/dao/HelpCenterNoticeDao.java
New file @@ -0,0 +1,18 @@ package com.xcong.excoin.modules.helpCenter.dao; import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.xcong.excoin.modules.helpCenter.entity.HelpCenterNoticeEntity; public interface HelpCenterNoticeDao extends BaseMapper<HelpCenterNoticeEntity> { IPage<HelpCenterNoticeEntity> getNewNoticeList(Page<HelpCenterNoticeEntity> page, @Param("record") HelpCenterNoticeEntity helpCenterNoticeEntity); IPage<HelpCenterNoticeEntity> getImportantNoticeList(Page<HelpCenterNoticeEntity> page, @Param("record") HelpCenterNoticeEntity helpCenterNoticeEntity); } src/main/java/com/xcong/excoin/modules/helpCenter/dao/HelpCenterTypeDao.java
New file @@ -0,0 +1,15 @@ package com.xcong.excoin.modules.helpCenter.dao; import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.xcong.excoin.modules.helpCenter.entity.HelpCenterTypeEntity; public interface HelpCenterTypeDao extends BaseMapper<HelpCenterTypeEntity> { IPage<HelpCenterTypeEntity> getNoticeTypeList(Page<HelpCenterTypeEntity> page, @Param("record") HelpCenterTypeEntity helpCenterTypeEntity); } src/main/java/com/xcong/excoin/modules/helpCenter/dto/ImportantNoticePageDto.java
New file @@ -0,0 +1,27 @@ package com.xcong.excoin.modules.helpCenter.dto; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "ImportantNoticePageDto", description = "参数接受类") public class ImportantNoticePageDto { @NotNull @Min(1) @ApiModelProperty(value = "第几页", example = "1") private int pageNum; @NotNull @ApiModelProperty(value = "每页数量", example = "10") private int pageSize; @NotNull @ApiModelProperty(value = "类型1:中文2:英文", example = "1") private int type; } src/main/java/com/xcong/excoin/modules/helpCenter/dto/NewNoticePageDto.java
New file @@ -0,0 +1,27 @@ package com.xcong.excoin.modules.helpCenter.dto; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "NewNoticePageDto", description = "参数接受类") public class NewNoticePageDto { @NotNull @Min(1) @ApiModelProperty(value = "第几页", example = "1") private int pageNum; @NotNull @ApiModelProperty(value = "每页数量", example = "10") private int pageSize; @NotNull @ApiModelProperty(value = "类型1:中文2:英文", example = "1") private int type; } src/main/java/com/xcong/excoin/modules/helpCenter/dto/NewNoticeTypePageDto.java
New file @@ -0,0 +1,27 @@ package com.xcong.excoin.modules.helpCenter.dto; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "NewNoticeTypePageDto", description = "参数接受类") public class NewNoticeTypePageDto { @NotNull @Min(1) @ApiModelProperty(value = "第几页", example = "1") private int pageNum; @NotNull @ApiModelProperty(value = "每页数量", example = "10") private int pageSize; @NotNull @ApiModelProperty(value = "类型1:中文2:英文", example = "1") private int type; } src/main/java/com/xcong/excoin/modules/helpCenter/dto/NoticeInfoDto.java
New file @@ -0,0 +1,19 @@ package com.xcong.excoin.modules.helpCenter.dto; import javax.validation.constraints.NotNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "NoticeInfoDto", description = "参数接受类") public class NoticeInfoDto { @NotNull @ApiModelProperty(value = "文章id", example = "10") private Long id; @NotNull @ApiModelProperty(value = "类型1:中文2:英文", example = "1") private int type; } src/main/java/com/xcong/excoin/modules/helpCenter/dto/NoticePageDto.java
New file @@ -0,0 +1,31 @@ package com.xcong.excoin.modules.helpCenter.dto; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "NoticePageDto", description = "参数接受类") public class NoticePageDto { @NotNull @Min(1) @ApiModelProperty(value = "第几页", example = "1") private int pageNum; @NotNull @ApiModelProperty(value = "每页数量", example = "10") private int pageSize; @NotNull @ApiModelProperty(value = "类型1:中文2:英文", example = "1") private int type; @NotNull @ApiModelProperty(value = "ID", example = "1") private Long id; } src/main/java/com/xcong/excoin/modules/helpCenter/entity/HelpCenterArticleEntity.java
New file @@ -0,0 +1,43 @@ package com.xcong.excoin.modules.helpCenter.entity; import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; /** * 文章内容 */ @Data @TableName("help_center_article") public class HelpCenterArticleEntity { @TableId(value = "id",type = IdType.AUTO) private Long id; /** * 创建者 */ private String createBy; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date createTime; /** * 语言类型(1:简体中文2:英文) */ private int typeLanguage; /** * 标题 */ private String title; /** * 内容 */ private String content; } src/main/java/com/xcong/excoin/modules/helpCenter/entity/HelpCenterNoticeEntity.java
New file @@ -0,0 +1,51 @@ package com.xcong.excoin.modules.helpCenter.entity; import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; /** * 帮助中心公告 */ @Data @TableName("help_center_notice") public class HelpCenterNoticeEntity { @TableId(value = "id",type = IdType.AUTO) private Long id; /** * 创建者 */ private String createBy; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date createTime; /** * 所属类别(1:最新公告2:重要公告) */ private int articleNotice; /** * 文章id */ private Long articleId; /** *文章标题 */ private String articleTitle; /** * 文章id */ private Long articleIdUs; /** *文章标题 */ private String articleTitleUs; } src/main/java/com/xcong/excoin/modules/helpCenter/entity/HelpCenterTypeEntity.java
New file @@ -0,0 +1,35 @@ package com.xcong.excoin.modules.helpCenter.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; /** * 帮助中心类别 */ @Data @TableName("help_center_type") public class HelpCenterTypeEntity { @TableId(value = "id",type = IdType.AUTO) private Long id; /** * 所属类别(1:帮助中心类别2:...) */ private int status; /** * 类型标识 */ private int type; /** *类型内容 */ private String content; /** *类型内容 */ private String contentUs; } src/main/java/com/xcong/excoin/modules/helpCenter/service/HelpCenterService.java
New file @@ -0,0 +1,33 @@ package com.xcong.excoin.modules.helpCenter.service; import javax.validation.Valid; import com.baomidou.mybatisplus.extension.service.IService; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.helpCenter.dto.ImportantNoticePageDto; import com.xcong.excoin.modules.helpCenter.dto.NewNoticePageDto; import com.xcong.excoin.modules.helpCenter.dto.NewNoticeTypePageDto; import com.xcong.excoin.modules.helpCenter.dto.NoticePageDto; import com.xcong.excoin.modules.helpCenter.entity.HelpCenterNoticeEntity; public interface HelpCenterService extends IService<HelpCenterNoticeEntity> { Result getNewNoticeList(@Valid NewNoticePageDto newNoticePageDto); Result getImportantNoticeList(@Valid ImportantNoticePageDto importantNoticePageDto); Result getNoticeInfo(long id); Result getNewNoticeTypeList(@Valid NewNoticeTypePageDto newNoticeTypePageDto); Result getNoticeList(@Valid NoticePageDto noticePageDto); Result getAboutUs(); Result getUserAgreement(); Result getFristNewNoticeList(@Valid NewNoticePageDto newNoticePageDto); } src/main/java/com/xcong/excoin/modules/helpCenter/service/impl/HelpCenterServiceImpl.java
New file @@ -0,0 +1,326 @@ package com.xcong.excoin.modules.helpCenter.service.impl; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.validation.Valid; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.helpCenter.dao.HelpCenterArticleDao; import com.xcong.excoin.modules.helpCenter.dao.HelpCenterNoticeDao; import com.xcong.excoin.modules.helpCenter.dao.HelpCenterTypeDao; import com.xcong.excoin.modules.helpCenter.dto.ImportantNoticePageDto; import com.xcong.excoin.modules.helpCenter.dto.NewNoticePageDto; import com.xcong.excoin.modules.helpCenter.dto.NewNoticeTypePageDto; import com.xcong.excoin.modules.helpCenter.dto.NoticePageDto; import com.xcong.excoin.modules.helpCenter.entity.HelpCenterArticleEntity; import com.xcong.excoin.modules.helpCenter.entity.HelpCenterNoticeEntity; import com.xcong.excoin.modules.helpCenter.entity.HelpCenterTypeEntity; import com.xcong.excoin.modules.helpCenter.service.HelpCenterService; import com.xcong.excoin.modules.helpCenter.vo.ImportantNoticeVo; import com.xcong.excoin.modules.helpCenter.vo.NewNoticeInfoVo; import com.xcong.excoin.modules.helpCenter.vo.NewNoticeTypeInfoVo; import com.xcong.excoin.modules.helpCenter.vo.NoticeInfoVo; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import lombok.extern.slf4j.Slf4j; @Slf4j @Service public class HelpCenterServiceImpl extends ServiceImpl<HelpCenterNoticeDao, HelpCenterNoticeEntity> implements HelpCenterService { @Resource private HelpCenterArticleDao helpCenterArticleDao; @Resource private HelpCenterNoticeDao helpCenterNoticeDao; @Resource private HelpCenterTypeDao helpCenterTypeDao; @Override public Result getNewNoticeList(@Valid NewNoticePageDto newNoticePageDto) { List<NewNoticeInfoVo> arrayList = new ArrayList<>(); Page<HelpCenterNoticeEntity> page = new Page<>(newNoticePageDto.getPageNum(), newNoticePageDto.getPageSize()); //获取【帮助中心公告】 HelpCenterNoticeEntity helpCenterNoticeEntity = new HelpCenterNoticeEntity(); IPage<HelpCenterNoticeEntity> HelpCenterNoticeEntitys = helpCenterNoticeDao.getNewNoticeList(page, helpCenterNoticeEntity); List<HelpCenterNoticeEntity> records = HelpCenterNoticeEntitys.getRecords(); if(CollUtil.isNotEmpty(records)) { for(HelpCenterNoticeEntity helpCenterNotice : records) { NewNoticeInfoVo newNoticeInfoVo = new NewNoticeInfoVo(); Long id = helpCenterNotice.getId(); newNoticeInfoVo.setId(id); String createBy = helpCenterNotice.getCreateBy(); newNoticeInfoVo.setCreateBy(createBy); Date createTime = helpCenterNotice.getCreateTime(); newNoticeInfoVo.setCreateTime(createTime); int articleNotice = helpCenterNotice.getArticleNotice(); newNoticeInfoVo.setArticleNotice(articleNotice); int type = newNoticePageDto.getType(); if(type == 2) { Long articleIdUs = helpCenterNotice.getArticleIdUs(); newNoticeInfoVo.setArticleId(articleIdUs); String articleTitleUs = helpCenterNotice.getArticleTitleUs(); newNoticeInfoVo.setArticleTitle(articleTitleUs); }else { Long articleId = helpCenterNotice.getArticleId(); newNoticeInfoVo.setArticleId(articleId); String articleTitle = helpCenterNotice.getArticleTitle(); newNoticeInfoVo.setArticleTitle(articleTitle); } arrayList.add(newNoticeInfoVo); } } return Result.ok(arrayList); } @Override public Result getImportantNoticeList(@Valid ImportantNoticePageDto importantNoticePageDto) { List<ImportantNoticeVo> arrayList = new ArrayList<>(); Page<HelpCenterNoticeEntity> page = new Page<>(importantNoticePageDto.getPageNum(), importantNoticePageDto.getPageSize()); //获取【帮助中心公告】 HelpCenterNoticeEntity helpCenterNoticeEntity = new HelpCenterNoticeEntity(); IPage<HelpCenterNoticeEntity> HelpCenterNoticeEntitys = helpCenterNoticeDao.getImportantNoticeList(page, helpCenterNoticeEntity); List<HelpCenterNoticeEntity> records = HelpCenterNoticeEntitys.getRecords(); if(CollUtil.isNotEmpty(records)) { for(HelpCenterNoticeEntity helpCenterNotice : records) { ImportantNoticeVo noticeInfoVo = new ImportantNoticeVo(); Long id = helpCenterNotice.getId(); noticeInfoVo.setId(id); String createBy = helpCenterNotice.getCreateBy(); noticeInfoVo.setCreateBy(createBy); Date createTime = helpCenterNotice.getCreateTime(); noticeInfoVo.setCreateTime(createTime); int articleNotice = helpCenterNotice.getArticleNotice(); noticeInfoVo.setArticleNotice(articleNotice); int type = importantNoticePageDto.getType(); if(type == 2) { Long articleIdUs = helpCenterNotice.getArticleIdUs(); noticeInfoVo.setArticleId(articleIdUs); String articleTitleUs = helpCenterNotice.getArticleTitleUs(); noticeInfoVo.setArticleTitle(articleTitleUs); }else { Long articleId = helpCenterNotice.getArticleId(); noticeInfoVo.setArticleId(articleId); String articleTitle = helpCenterNotice.getArticleTitle(); noticeInfoVo.setArticleTitle(articleTitle); } arrayList.add(noticeInfoVo); } } return Result.ok(arrayList); } @Override public Result getNoticeInfo(long id) { HelpCenterArticleEntity helpCenterArticleEntity = helpCenterArticleDao.selectById(id); NoticeInfoVo noticeInfoVo = new NoticeInfoVo(); if(ObjectUtil.isNotEmpty(helpCenterArticleEntity)) { String content = helpCenterArticleEntity.getContent(); noticeInfoVo.setContent(content); String createBy = helpCenterArticleEntity.getCreateBy(); noticeInfoVo.setCreateBy(createBy); Date createTime = helpCenterArticleEntity.getCreateTime(); noticeInfoVo.setCreateTime(createTime); String title = helpCenterArticleEntity.getTitle(); noticeInfoVo.setTitle(title); int typeLanguage = helpCenterArticleEntity.getTypeLanguage(); noticeInfoVo.setTypeLanguage(typeLanguage); noticeInfoVo.setId(id); } return Result.ok(noticeInfoVo); } @Override public Result getNewNoticeTypeList(@Valid NewNoticeTypePageDto newNoticeTypePageDto) { List<NewNoticeTypeInfoVo> arrayList = new ArrayList<>(); Page<HelpCenterTypeEntity> page = new Page<>(newNoticeTypePageDto.getPageNum(), newNoticeTypePageDto.getPageSize()); //获取【类别】 HelpCenterTypeEntity helpCenterTypeEntity = new HelpCenterTypeEntity(); IPage<HelpCenterTypeEntity> helpCenterTypeEntitys = helpCenterTypeDao.getNoticeTypeList(page, helpCenterTypeEntity); List<HelpCenterTypeEntity> records = helpCenterTypeEntitys.getRecords(); if(CollUtil.isNotEmpty(records)) { for(HelpCenterTypeEntity helpCenterType : records) { NewNoticeTypeInfoVo noticeInfoVo = new NewNoticeTypeInfoVo(); Long id = helpCenterType.getId(); noticeInfoVo.setId(id); int type = newNoticeTypePageDto.getType(); if(type == 2) { String contentUs = helpCenterType.getContentUs(); noticeInfoVo.setContent(contentUs); }else { String content = helpCenterType.getContent(); noticeInfoVo.setContent(content); } arrayList.add(noticeInfoVo); } } return Result.ok(arrayList); } @Override public Result getNoticeList(@Valid NoticePageDto noticePageDto) { List<NewNoticeInfoVo> arrayList = new ArrayList<>(); int noticeType = noticePageDto.getType(); //获取【类别】数据 Long id = noticePageDto.getId(); HelpCenterTypeEntity helpCenterTypeEntity = helpCenterTypeDao.selectById(id); if(ObjectUtil.isNotEmpty(helpCenterTypeEntity)) { int type = helpCenterTypeEntity.getType(); //获取对应的【帮助中心公告】 Map<String, Object> columnMap = new HashMap<String, Object>(); columnMap.put("article_notice", type); List<HelpCenterNoticeEntity> helpCenterNoticeEntitys = helpCenterNoticeDao.selectByMap(columnMap); if(CollUtil.isNotEmpty(helpCenterNoticeEntitys)) { for(HelpCenterNoticeEntity helpCenterNoticeEntity : helpCenterNoticeEntitys) { NewNoticeInfoVo newNoticeInfoVo = new NewNoticeInfoVo(); Long noticeId = helpCenterNoticeEntity.getId(); newNoticeInfoVo.setId(noticeId); String createBy = helpCenterNoticeEntity.getCreateBy(); newNoticeInfoVo.setCreateBy(createBy); Date createTime = helpCenterNoticeEntity.getCreateTime(); newNoticeInfoVo.setCreateTime(createTime); if(noticeType == 2) { Long articleIdUs = helpCenterNoticeEntity.getArticleIdUs(); newNoticeInfoVo.setArticleId(articleIdUs); String articleTitle = helpCenterNoticeEntity.getArticleTitleUs(); newNoticeInfoVo.setArticleTitle(articleTitle); }else { Long articleId = helpCenterNoticeEntity.getArticleId(); newNoticeInfoVo.setArticleId(articleId); String articleTitle = helpCenterNoticeEntity.getArticleTitle(); helpCenterNoticeEntity.getArticleTitle(); newNoticeInfoVo.setArticleTitle(articleTitle); } arrayList.add(newNoticeInfoVo); } } } return Result.ok(arrayList); } @Override public Result getAboutUs() { NoticeInfoVo noticeInfoVo = new NoticeInfoVo(); HelpCenterArticleEntity selectById = helpCenterArticleDao.selectById(27); if(ObjectUtil.isNotEmpty(selectById)) { String createBy = selectById.getCreateBy(); noticeInfoVo.setCreateBy(createBy); String content = selectById.getContent(); noticeInfoVo.setContent(content); Date createTime = selectById.getCreateTime(); noticeInfoVo.setCreateTime(createTime); String title = selectById.getTitle(); noticeInfoVo.setTitle(title); int typeLanguage = selectById.getTypeLanguage(); noticeInfoVo.setTypeLanguage(typeLanguage); Long id = selectById.getId(); noticeInfoVo.setId(id); } return Result.ok(noticeInfoVo); } @Override public Result getUserAgreement() { NoticeInfoVo noticeInfoVo = new NoticeInfoVo(); HelpCenterArticleEntity selectById = helpCenterArticleDao.selectById(29); if(ObjectUtil.isNotEmpty(selectById)) { String createBy = selectById.getCreateBy(); noticeInfoVo.setCreateBy(createBy); String content = selectById.getContent(); noticeInfoVo.setContent(content); Date createTime = selectById.getCreateTime(); noticeInfoVo.setCreateTime(createTime); String title = selectById.getTitle(); noticeInfoVo.setTitle(title); int typeLanguage = selectById.getTypeLanguage(); noticeInfoVo.setTypeLanguage(typeLanguage); Long id = selectById.getId(); noticeInfoVo.setId(id); } return Result.ok(noticeInfoVo); } @Override public Result getFristNewNoticeList(@Valid NewNoticePageDto newNoticePageDto) { List<NewNoticeInfoVo> arrayList = new ArrayList<>(); Page<HelpCenterNoticeEntity> page = new Page<>(1, 5); //获取【帮助中心公告】 HelpCenterNoticeEntity helpCenterNoticeEntity = new HelpCenterNoticeEntity(); IPage<HelpCenterNoticeEntity> HelpCenterNoticeEntitys = helpCenterNoticeDao.getNewNoticeList(page, helpCenterNoticeEntity); List<HelpCenterNoticeEntity> records = HelpCenterNoticeEntitys.getRecords(); if(CollUtil.isNotEmpty(records)) { for(HelpCenterNoticeEntity helpCenterNotice : records) { NewNoticeInfoVo newNoticeInfoVo = new NewNoticeInfoVo(); Long id = helpCenterNotice.getId(); newNoticeInfoVo.setId(id); String createBy = helpCenterNotice.getCreateBy(); newNoticeInfoVo.setCreateBy(createBy); Date createTime = helpCenterNotice.getCreateTime(); newNoticeInfoVo.setCreateTime(createTime); int articleNotice = helpCenterNotice.getArticleNotice(); newNoticeInfoVo.setArticleNotice(articleNotice); int type = newNoticePageDto.getType(); if(type == 2) { Long articleIdUs = helpCenterNotice.getArticleIdUs(); newNoticeInfoVo.setArticleId(articleIdUs); String articleTitleUs = helpCenterNotice.getArticleTitleUs(); newNoticeInfoVo.setArticleTitle(articleTitleUs); }else { Long articleId = helpCenterNotice.getArticleId(); newNoticeInfoVo.setArticleId(articleId); String articleTitle = helpCenterNotice.getArticleTitle(); newNoticeInfoVo.setArticleTitle(articleTitle); } arrayList.add(newNoticeInfoVo); } } return Result.ok(arrayList); } } src/main/java/com/xcong/excoin/modules/helpCenter/vo/ImportantNoticeVo.java
New file @@ -0,0 +1,44 @@ package com.xcong.excoin.modules.helpCenter.vo; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "ImportantNoticeVo", description = "参数返回类") public class ImportantNoticeVo { @ApiModelProperty("ID") private Long id; /** * 创建者 */ @ApiModelProperty("创建者") private String createBy; /** * 创建时间 */ @ApiModelProperty("创建时间") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date createTime; /** * 所属类别(1:最新公告2:重要公告) */ @ApiModelProperty("所属类别(1:最新公告2:重要公告)") private int articleNotice; /** * 文章id */ @ApiModelProperty("文章id") private Long articleId; /** *文章标题 */ @ApiModelProperty("文章标题") private String articleTitle; } src/main/java/com/xcong/excoin/modules/helpCenter/vo/NewNoticeInfoVo.java
New file @@ -0,0 +1,44 @@ package com.xcong.excoin.modules.helpCenter.vo; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "NewNoticeInfoVo", description = "参数返回类") public class NewNoticeInfoVo { @ApiModelProperty("ID") private Long id; /** * 创建者 */ @ApiModelProperty("创建者") private String createBy; /** * 创建时间 */ @ApiModelProperty("创建时间") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date createTime; /** * 所属类别(1:最新公告2:重要公告) */ @ApiModelProperty("所属类别(1:最新公告2:重要公告)") private int articleNotice; /** * 文章id */ @ApiModelProperty("文章id") private Long articleId; /** *文章标题 */ @ApiModelProperty("文章标题") private String articleTitle; } src/main/java/com/xcong/excoin/modules/helpCenter/vo/NewNoticeTypeInfoVo.java
New file @@ -0,0 +1,19 @@ package com.xcong.excoin.modules.helpCenter.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "NewNoticeTypeInfoVo", description = "参数返回类") public class NewNoticeTypeInfoVo { @ApiModelProperty("ID") private Long id; /** *类型内容 */ @ApiModelProperty("类型内容") private String content; } src/main/java/com/xcong/excoin/modules/helpCenter/vo/NoticeInfoVo.java
New file @@ -0,0 +1,43 @@ package com.xcong.excoin.modules.helpCenter.vo; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "NoticeInfoVo", description = "参数返回类") public class NoticeInfoVo { @ApiModelProperty("ID") private Long id; /** * 创建者 */ @ApiModelProperty("创建者") private String createBy; /** * 创建时间 */ @ApiModelProperty("创建时间") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date createTime; /** * 语言类型(1:简体中文2:英文) */ @ApiModelProperty("语言类型(1:简体中文2:英文)") private int typeLanguage; /** * 标题 */ @ApiModelProperty("标题") private String title; /** * 内容 */ @ApiModelProperty("内容") private String content; } src/main/resources/mapper/helpCenter/HelpCenterNoticeDao.xml
New file @@ -0,0 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.xcong.excoin.modules.helpCenter.dao.HelpCenterNoticeDao"> <select id="getNewNoticeList" resultType="com.xcong.excoin.modules.helpCenter.entity.HelpCenterNoticeEntity"> SELECT * FROM help_center_notice WHERE article_notice = 1 ORDER BY create_time DESC </select> <select id="getImportantNoticeList" resultType="com.xcong.excoin.modules.helpCenter.entity.HelpCenterNoticeEntity"> SELECT * FROM help_center_notice WHERE article_notice = 2 ORDER BY create_time DESC </select> </mapper> src/main/resources/mapper/helpCenter/HelpCenterTypeDao.xml
New file @@ -0,0 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.xcong.excoin.modules.helpCenter.dao.HelpCenterTypeDao"> <select id="getNoticeTypeList" resultType="com.xcong.excoin.modules.helpCenter.entity.HelpCenterTypeEntity"> SELECT * FROM help_center_type WHERE status = 1 </select> </mapper> src/main/resources/mapper/walletCoinOrder/OrderCoinDealDao.xml
@@ -44,6 +44,13 @@ order by create_time desc </select> <select id="selectAllCoinDealsOrderBySymbol" resultType="com.xcong.excoin.modules.coin.entity.OrderCoinsDealEntity"> select * from coins_order_deal where symbol = #{symbol} order by create_time desc limit 100 </select> <select id="selectWalletCoinOrder" resultType="com.xcong.excoin.modules.coin.entity.OrderCoinsDealEntity"> select * from coins_order_deal where order_id= #{orderId} and member_id = #{memberId} </select>