Commit 124252aa authored by tangtuo's avatar tangtuo

v1.0.0功能开发

parent d171866f
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
<profile version="1.0"> <profile version="1.0">
<option name="myName" value="Project Default" /> <option name="myName" value="Project Default" />
<inspection_tool class="ArgNamesErrorsInspection" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="ArgNamesErrorsInspection" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="57" name="Java" />
</Languages>
</inspection_tool>
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS"> <option name="TOP_LEVEL_CLASS_OPTIONS">
<value> <value>
......
package com.fzm.admin.controller;
import com.fzm.common.annotation.Authentication;
import com.fzm.common.entity.vo.CopyrightApplyVo;
import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.CopyrightApplyService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2021/12/15 10:27
*/
@Authentication
@RestController
@RequestMapping(value = "/copyright/apply")
@Api(tags = "版权审核")
public class CopyrightApplyController {
@Resource
private CopyrightApplyService copyrightApplyService;
@GetMapping(value = "/pages")
@ApiOperation(value = "分页查询")
public ResponseModel<PageInfo<CopyrightApplyVo>> page(@ApiParam(value = "页码", required = true) @RequestParam Integer pageNum,
@ApiParam(value = "每页记录数", required = true) @RequestParam Integer pageSize,
@ApiParam(value = "手机号") @RequestParam(required = false) String telephone,
@ApiParam(value = "流水号") @RequestParam(required = false) String serialNum,
@ApiParam(value = "审核状态") @RequestParam(required = false) Integer registerState,
@ApiParam(value = "审核开始日期 yyyy-MM-dd") @RequestParam(required = false) String from,
@ApiParam(value = "审核截止日期 yyyy-MM-dd") @RequestParam(required = false) String to) {
PageInfo<CopyrightApplyVo> pages = copyrightApplyService.pages(pageNum, pageSize, telephone, serialNum, registerState, from, to);
return ResponseModel.success(pages);
}
@PostMapping(value = "/pass")
@ApiOperation(value = "通过")
public ResponseModel<Boolean> pass(@RequestParam Integer id) {
boolean result = copyrightApplyService.pass(id);
return ResponseModel.success(result);
}
@PostMapping(value = "/reject")
@ApiOperation(value = "驳回")
public ResponseModel<Boolean> reject(@RequestParam Integer id, @RequestParam String rejectReason) {
boolean result = copyrightApplyService.reject(id, rejectReason);
return ResponseModel.success(result);
}
}
package com.fzm.common.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author tangtuo
*
* <p>
* 异步线程池配置
* </p>
*/
@Configuration
@EnableAsync
public class AsyncConfig {
@Bean
public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(5);
executor.setMaxPoolSize(200);
executor.setQueueCapacity(200);
executor.setKeepAliveSeconds(60);
executor.setThreadNamePrefix("Service-");
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.setAwaitTerminationSeconds(60);
return executor;
}
}
\ No newline at end of file
...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fzm.common.entity.dto.CopyrightDTO; import com.fzm.common.entity.dto.CopyrightDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -85,6 +86,13 @@ public class CopyrightApply { ...@@ -85,6 +86,13 @@ public class CopyrightApply {
@ApiModelProperty(value = "登记状态 0-待审核 1-登记成功 2-审核失败") @ApiModelProperty(value = "登记状态 0-待审核 1-登记成功 2-审核失败")
private Integer registerState; private Integer registerState;
@ApiModelProperty(value = "驳回理由")
private String rejectReason;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@ApiModelProperty("json串")
private String content;
private Date createDate; private Date createDate;
private Date updateDate; private Date updateDate;
......
package com.fzm.common.entity; package com.fzm.common.entity;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/** /**
* @author tangtuo * @author tangtuo
...@@ -13,6 +22,75 @@ import lombok.Data; ...@@ -13,6 +22,75 @@ import lombok.Data;
@TableName(value = "tb_copyright_apply_owner_relation") @TableName(value = "tb_copyright_apply_owner_relation")
public class CopyrightApplyOwnerRelation { public class CopyrightApplyOwnerRelation {
@TableField(value = "copyright_id")
@ApiModelProperty(value = "版权id")
private Integer copyrightId; private Integer copyrightId;
@TableField(value = "owner_id")
@ApiModelProperty(value = "著作权人id")
private Integer ownerId; private Integer ownerId;
@NotNull(message = "著作权人类型不能为空")
@ApiModelProperty(value = "类别 0-自然人 1-法人")
private Integer type;
@NotBlank(message = "著作权人不能为空")
@ApiModelProperty(value = "著作权人")
private String owner;
@NotBlank(message = "证件号码不能为空")
@ApiModelProperty(value = "证件号码")
private String idNumber;
@NotNull(message = "证件是否长期有效不能为空")
@ApiModelProperty(value = "是否长期有效 0-否 1-是")
private Integer isEffective;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@NotNull(message = "证件有效期起始时间不能为空")
@ApiModelProperty(value = "证件有效起止时间")
private Date effectiveStartDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "证件有效终止时间")
private Date effectiveEndDate;
@NotBlank(message = "用户所在省份不能为空")
@ApiModelProperty(value = "用户所在省份")
private String province;
@NotBlank(message = "用户所在城市不能为空")
@ApiModelProperty(value = "用户所在城市")
private String city;
@ApiModelProperty(value = "证件类型 0-身份证 1-营业执照 2-企业法人营业执照 3-组织机构代码证书 4-事业单位法人证书 5-社团法人证书 6-统一社会信用代码 7其他有效证件")
private Integer idType;
@ApiModelProperty(value = "正面照片 (身份证人像面照片)")
private String positivePhoto;
@ApiModelProperty(value = "反面照片(身份证国徽面照片)")
private String backPhoto;
@ApiModelProperty(value = "手持身份证照片")
private String personalPhoto;
@ApiModelProperty(value = "证件照片(营业执照等)")
private String certificatesPhoto;
@NotBlank(message = "委托证明不能为空")
@ApiModelProperty(value = "委托证明")
private String entrustProve;
private Date createDate;
private Date updateDate;
public CopyrightApplyOwnerRelation(Integer copyrightId,CopyrightOwner copyrightOwner) {
this.copyrightId = copyrightId;
this.ownerId = copyrightOwner.getId();
BeanUtil.copyProperties(copyrightOwner, this, true);
}
} }
...@@ -53,7 +53,6 @@ public class CopyrightOwner { ...@@ -53,7 +53,6 @@ public class CopyrightOwner {
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@NotNull(message = "证件有效期终止时间不能为空")
@ApiModelProperty(value = "证件有效终止时间") @ApiModelProperty(value = "证件有效终止时间")
private Date effectiveEndDate; private Date effectiveEndDate;
...@@ -88,9 +87,5 @@ public class CopyrightOwner { ...@@ -88,9 +87,5 @@ public class CopyrightOwner {
private Date updateDate; private Date updateDate;
public CopyrightOwner(CopyrightDTO.Owner owner) {
BeanUtil.copyProperties(owner, this, true);
}
} }
...@@ -4,6 +4,7 @@ package com.fzm.common.entity; ...@@ -4,6 +4,7 @@ package com.fzm.common.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -22,6 +23,7 @@ public class Draft { ...@@ -22,6 +23,7 @@ public class Draft {
@ApiModelProperty("内容") @ApiModelProperty("内容")
private String content; private String content;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
@ApiModelProperty("草稿json串") @ApiModelProperty("草稿json串")
private String json; private String json;
......
...@@ -15,6 +15,9 @@ import java.util.List; ...@@ -15,6 +15,9 @@ import java.util.List;
@Data @Data
public class CopyrightDTO { public class CopyrightDTO {
@ApiModelProperty("主键")
private Integer id;
@ApiModelProperty(value = "nft哈希") @ApiModelProperty(value = "nft哈希")
private String nftHash; private String nftHash;
...@@ -47,6 +50,7 @@ public class CopyrightDTO { ...@@ -47,6 +50,7 @@ public class CopyrightDTO {
@ApiModelProperty(value = "作品完成城市") @ApiModelProperty(value = "作品完成城市")
private String opusCompleteCity; private String opusCompleteCity;
@ApiModelProperty(value = "'发表状态 0-未发表 1-已发表") @ApiModelProperty(value = "'发表状态 0-未发表 1-已发表")
private Integer publishState; private Integer publishState;
...@@ -85,6 +89,9 @@ public class CopyrightDTO { ...@@ -85,6 +89,9 @@ public class CopyrightDTO {
@ApiModelProperty("权力id集合") @ApiModelProperty("权力id集合")
private List<Integer> authorityIds; private List<Integer> authorityIds;
@ApiModelProperty("json串")
private String content;
@Data @Data
public static class Author { public static class Author {
...@@ -99,56 +106,6 @@ public class CopyrightDTO { ...@@ -99,56 +106,6 @@ public class CopyrightDTO {
} }
@Data
public static class Owner {
@ApiModelProperty(value = "类别 0-自然人 1-法人")
private Integer type;
@ApiModelProperty(value = "著作权人")
private String owner;
@ApiModelProperty(value = "证件号码")
private String idNumber;
@ApiModelProperty(value = "是否长期有效 0-否 1-是")
private Integer isEffective;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "证件有效起止时间 格式:yyyy-MM-dd")
private Date effectiveStartDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "证件有效终止时间 格式:yyyy-MM-dd")
private Date effectiveEndDate;
@ApiModelProperty(value = "用户所在省份")
private String province;
@ApiModelProperty(value = "用户所在城市")
private String city;
@ApiModelProperty(value = "证件类型 0-身份证 1-营业执照 2-企业法人营业执照 3-组织机构代码证书 4-事业单位法人证书 5-社团法人证书 6-统一社会信用代码 7其他有效证件")
private Integer idType;
@ApiModelProperty(value = "正面照片 (身份证人像面照片)")
private String positivePhoto;
@ApiModelProperty(value = "反面照片(身份证国徽面照片)")
private String backPhoto;
@ApiModelProperty(value = "手持身份证照片")
private String personalPhoto;
@ApiModelProperty(value = "证件照片(营业执照等)")
private String certificatesPhoto;
@ApiModelProperty(value = "委托证明")
private String entrustProve;
}
@Data @Data
public static class File { public static class File {
......
/**
* Copyright 2021 bejson.com
*/
package com.fzm.common.entity.dto;
import cn.hutool.core.date.DateUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* Auto-generated: 2021-12-15 16:10:11
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class CopyrightRequest {
private String app_id;
private String charset = "utf-8";
private String sign;
private String sign_type;
private String timestamp = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
private String version = "1.0";
private CopyrightDetail biz_content;
@Data
public static class CopyrightDetail {
@ApiModelProperty(value = "")
private String affilia_photo;
@ApiModelProperty(value = "")
private String agency_photo;
@ApiModelProperty(value = "")
private String author_photo;
@ApiModelProperty(value = "")
private List<Cooperator> cooperator;
@ApiModelProperty(value = "")
private String end_address;
@ApiModelProperty(value = "")
private String end_time;
@ApiModelProperty(value = "")
private String entrust_photo;
@ApiModelProperty(value = "")
private Integer gain_code;
@ApiModelProperty(value = "")
private String gain_desc;
@ApiModelProperty(value = "")
private String gain_name;
@ApiModelProperty(value = "")
private String gain_photo;
@ApiModelProperty(value = "")
private String geren_uname;
@ApiModelProperty(value = "")
private String geren_uxname;
@ApiModelProperty(value = "")
private String geren_uxname_type;
@ApiModelProperty(value = "")
private String geren_uxname_type_name;
@ApiModelProperty(value = "")
private Integer is_grade;
@ApiModelProperty(value = "")
private Integer nature_code;
@ApiModelProperty(value = "")
private String nature_desc;
@ApiModelProperty(value = "")
private String nature_name;
@ApiModelProperty(value = "")
private String other_photo;
@ApiModelProperty(value = "")
private List<CopyrightOwner> owner_list;
@ApiModelProperty(value = "")
private String publish_address;
@ApiModelProperty(value = "")
private int publish_status;
@ApiModelProperty(value = "")
private String publish_time;
@ApiModelProperty(value = "")
private int rights_affilia_code;
@ApiModelProperty(value = "")
private String rights_affilia_name;
@ApiModelProperty(value = "")
private String rights_desc;
@ApiModelProperty(value = "")
private String rights_guarantee_photo;
@ApiModelProperty(value = "")
private String works_create_desc;
@ApiModelProperty(value = "")
private String works_desc;
@ApiModelProperty(value = "")
private List<WorksFile> works_files;
@ApiModelProperty(value = "")
private String works_name;
@ApiModelProperty(value = "")
private String works_type_code;
@ApiModelProperty(value = "")
private String works_type_desc;
@ApiModelProperty(value = "")
private String works_type_name;
}
@Data
public static class Cooperator {
@ApiModelProperty(value = "")
private String signature_type;
@ApiModelProperty(value = "")
private String signature_type_name;
@ApiModelProperty(value = "")
private String uname;
@ApiModelProperty(value = "")
private String uxname;
}
@Data
public static class CopyrightOwner {
@ApiModelProperty(value = "")
private String address;
@ApiModelProperty(value = "")
private String back_photo;
@ApiModelProperty(value = "")
private String city;
@ApiModelProperty(value = "")
private String city_id;
@ApiModelProperty(value = "")
private String company_photo;
@ApiModelProperty(value = "")
private String document_code;
@ApiModelProperty(value = "")
private String document_image;
@ApiModelProperty(value = "")
private int document_type_code;
@ApiModelProperty(value = "")
private String document_type_name;
@ApiModelProperty(value = "")
private String front_photo;
@ApiModelProperty(value = "")
private String handheld_photo;
@ApiModelProperty(value = "")
private int is_forever;
@ApiModelProperty(value = "")
private String other_document_code;
@ApiModelProperty(value = "")
private String other_end_date;
@ApiModelProperty(value = "")
private String owner_name;
@ApiModelProperty(value = "")
private String owner_sign_name;
@ApiModelProperty(value = "")
private String owner_type_code;
@ApiModelProperty(value = "")
private String owner_type_name;
@ApiModelProperty(value = "")
private String prove_photo;
@ApiModelProperty(value = "")
private String province;
@ApiModelProperty(value = "")
private String province_id;
@ApiModelProperty(value = "")
private String valid_end_date;
@ApiModelProperty(value = "")
private String valid_start_date;
}
@Data
public static class WorksFile {
@ApiModelProperty(value = "")
private String file;
@ApiModelProperty(value = "")
private String file_format;
@ApiModelProperty(value = "")
private String file_name;
@ApiModelProperty(value = "")
private String file_size;
@ApiModelProperty(value = "")
private String file_token;
@ApiModelProperty(value = "")
private String keywords;
}
}
\ No newline at end of file
...@@ -32,6 +32,9 @@ public class CollectionNftVo { ...@@ -32,6 +32,9 @@ public class CollectionNftVo {
@ApiModelProperty("nft编号") @ApiModelProperty("nft编号")
private String nftId; private String nftId;
@ApiModelProperty("nft哈希")
private String nftHash;
@ApiModelProperty("是否是纪念版nft 0-否 1-是") @ApiModelProperty("是否是纪念版nft 0-否 1-是")
private Integer isCommemorate; private Integer isCommemorate;
...@@ -42,6 +45,6 @@ public class CollectionNftVo { ...@@ -42,6 +45,6 @@ public class CollectionNftVo {
this.name = nft.getName(); this.name = nft.getName();
this.cover = nft.getCover(); this.cover = nft.getCover();
this.isCommemorate = nft.getIsCommemorate(); this.isCommemorate = nft.getIsCommemorate();
this.fileUrl=nft.getFileUrl(); this.fileUrl = nft.getFileUrl();
} }
} }
package com.fzm.common.entity.vo;
import cn.hutool.core.bean.BeanUtil;
import com.fzm.common.entity.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author tangtuo
* @date 2021/12/13 11:35
*/
@Data
public class CopyrightApplyVo {
@ApiModelProperty(value = "主键")
private Integer id;
@ApiModelProperty(value = "流水号")
private String serialNum;
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "申请账号")
private String telephone;
@ApiModelProperty(value = "用户昵称")
private String nickname;
@ApiModelProperty(value = "nft哈希")
private String nftHash;
@ApiModelProperty(value = "nft名称")
private String nftName;
@ApiModelProperty(value = "作品名称")
private String opusName;
@ApiModelProperty(value = "登记状态 -1:已撤回 0:待审核 2:已提交 3:已驳回 4:登记成功 5:审核失败 ")
private Integer registerState;
@ApiModelProperty(value = "申请时间")
private Date createDate;
}
...@@ -91,7 +91,7 @@ public class CopyrightVo { ...@@ -91,7 +91,7 @@ public class CopyrightVo {
private List<Authority> authorities; private List<Authority> authorities;
@ApiModelProperty(value = "著作权人列表") @ApiModelProperty(value = "著作权人列表")
private List<CopyrightOwner> owners; private List<CopyrightApplyOwnerRelation> owners;
public CopyrightVo(CopyrightApply copyrightApply) { public CopyrightVo(CopyrightApply copyrightApply) {
BeanUtil.copyProperties(copyrightApply, this, true); BeanUtil.copyProperties(copyrightApply, this, true);
......
package com.fzm.common.mapper; package com.fzm.common.mapper;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fzm.common.entity.CopyrightApply; import com.fzm.common.entity.CopyrightApply;
import com.fzm.common.entity.vo.CopyrightApplyVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -22,4 +24,6 @@ public interface CopyrightApplyMapper extends BaseMapper<CopyrightApply> { ...@@ -22,4 +24,6 @@ public interface CopyrightApplyMapper extends BaseMapper<CopyrightApply> {
* @return * @return
*/ */
List<CopyrightApply> list(@Param("userId") Integer userId, @Param("state") Integer state); List<CopyrightApply> list(@Param("userId") Integer userId, @Param("state") Integer state);
List<CopyrightApplyVo> pages(@Param("telephone") String telephone, @Param("serialNum") String serialNum, @Param("registerState") Integer registerState, @Param("startDate") DateTime startDate, @Param("endDate") DateTime endDate);
} }
...@@ -44,4 +44,6 @@ public interface NftMapper extends BaseMapper<Nft> { ...@@ -44,4 +44,6 @@ public interface NftMapper extends BaseMapper<Nft> {
List<NftListVo> page(@Param("categoryId") Integer categoryId, @Param("name") String name, @Param("telephone") String telephone, @Param("status") Integer status, @Param("startDate") DateTime startDate, @Param("endDate") DateTime endDate); List<NftListVo> page(@Param("categoryId") Integer categoryId, @Param("name") String name, @Param("telephone") String telephone, @Param("status") Integer status, @Param("startDate") DateTime startDate, @Param("endDate") DateTime endDate);
List<CollectionNftVo> listCurrent(@Param("categoryId") Integer categoryId, @Param("userId") Integer userId); List<CollectionNftVo> listCurrent(@Param("categoryId") Integer categoryId, @Param("userId") Integer userId);
List<CollectionNftVo> listCopyright(@Param("userId") Integer userId);
} }
...@@ -3,9 +3,28 @@ package com.fzm.common.service; ...@@ -3,9 +3,28 @@ package com.fzm.common.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fzm.common.entity.CopyrightApplyOwnerRelation; import com.fzm.common.entity.CopyrightApplyOwnerRelation;
import java.util.List;
/** /**
* @author tangtuo * @author tangtuo
* @date 2021/12/13 11:24 * @date 2021/12/13 11:24
*/ */
public interface CopyrightApplyOwnerRelationService extends IService<CopyrightApplyOwnerRelation> { public interface CopyrightApplyOwnerRelationService extends IService<CopyrightApplyOwnerRelation> {
/**
* 根据版权id删除记录
*
* @param copyrightId
* @return
*/
Integer delByCopyrightId(Integer copyrightId);
/**
* 根据版权id查询
*
* @param copyrightId
* @return
*/
List<CopyrightApplyOwnerRelation> getByCopyrightId(Integer copyrightId);
} }
...@@ -3,9 +3,12 @@ package com.fzm.common.service; ...@@ -3,9 +3,12 @@ package com.fzm.common.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fzm.common.entity.CopyrightApply; import com.fzm.common.entity.CopyrightApply;
import com.fzm.common.entity.dto.CopyrightDTO; import com.fzm.common.entity.dto.CopyrightDTO;
import com.fzm.common.entity.vo.CopyrightApplyVo;
import com.fzm.common.entity.vo.CopyrightVo; import com.fzm.common.entity.vo.CopyrightVo;
import com.github.pagehelper.PageInfo;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException;
/** /**
* @author tangtuo * @author tangtuo
...@@ -31,12 +34,12 @@ public interface CopyrightApplyService extends IService<CopyrightApply> { ...@@ -31,12 +34,12 @@ public interface CopyrightApplyService extends IService<CopyrightApply> {
List<CopyrightApply> list(Integer userId, Integer state); List<CopyrightApply> list(Integer userId, Integer state);
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
Boolean reject(Integer id); Boolean withdraw(Integer id);
/** /**
...@@ -53,5 +56,43 @@ public interface CopyrightApplyService extends IService<CopyrightApply> { ...@@ -53,5 +56,43 @@ public interface CopyrightApplyService extends IService<CopyrightApply> {
* @param id * @param id
* @return * @return
*/ */
CopyrightVo getDetail(Integer id); CopyrightVo getDetail(Integer id) throws ExecutionException, InterruptedException;
/**
* 修改
*
* @param copyrightDTO
*/
Boolean update(CopyrightDTO copyrightDTO);
/**
* 分页查询
*
* @param pageNum
* @param pageSize
* @param telephone
* @param serialNum
* @param registerState
* @param from
* @param to
* @return
*/
PageInfo<CopyrightApplyVo> pages(Integer pageNum, Integer pageSize, String telephone, String serialNum, Integer registerState, String from, String to);
/**
* 驳回
*
* @param id
* @param rejectReason
* @return
*/
boolean reject(Integer id, String rejectReason);
/**
* 审核通过
*
* @param id
* @return
*/
boolean pass(Integer id);
} }
...@@ -15,4 +15,6 @@ public interface CopyrightAuthorityRelationService extends IService<CopyrightAut ...@@ -15,4 +15,6 @@ public interface CopyrightAuthorityRelationService extends IService<CopyrightAut
* @param copyrightId * @param copyrightId
*/ */
Integer delByCopyrightId(Integer copyrightId); Integer delByCopyrightId(Integer copyrightId);
int insert(CopyrightAuthorityRelation CopyrightAuthorityRelation);
} }
...@@ -144,4 +144,12 @@ public interface NftService extends IService<Nft> { ...@@ -144,4 +144,12 @@ public interface NftService extends IService<Nft> {
* @return * @return
*/ */
Nft getByNftHash(String nftHash); Nft getByNftHash(String nftHash);
/**
* 查询用户还未申请版权的nft列表
*
* @param userId
* @return
*/
List<CollectionNftVo> listCopyright(Integer userId);
} }
package com.fzm.common.service.impl; package com.fzm.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.CopyrightApplyOwnerRelation; import com.fzm.common.entity.CopyrightApplyOwnerRelation;
import com.fzm.common.mapper.CopyrightApplyOwnerRelationMapper; import com.fzm.common.mapper.CopyrightApplyOwnerRelationMapper;
import com.fzm.common.service.CopyrightApplyOwnerRelationService; import com.fzm.common.service.CopyrightApplyOwnerRelationService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* @author tangtuo * @author tangtuo
* @date 2021/12/13 11:25 * @date 2021/12/13 11:25
*/ */
@Service @Service
public class CopyrightApplyOwnerRelationServiceImpl extends ServiceImpl<CopyrightApplyOwnerRelationMapper, CopyrightApplyOwnerRelation> implements CopyrightApplyOwnerRelationService { public class CopyrightApplyOwnerRelationServiceImpl extends ServiceImpl<CopyrightApplyOwnerRelationMapper, CopyrightApplyOwnerRelation> implements CopyrightApplyOwnerRelationService {
@Resource
private CopyrightApplyOwnerRelationMapper copyrightApplyOwnerRelationMapper;
@Override
public Integer delByCopyrightId(Integer copyrightId) {
UpdateWrapper<CopyrightApplyOwnerRelation> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("copyright_id", copyrightId);
return copyrightApplyOwnerRelationMapper.delete(updateWrapper);
}
@Override
public List<CopyrightApplyOwnerRelation> getByCopyrightId(Integer copyrightId) {
QueryWrapper<CopyrightApplyOwnerRelation> wrapper = new QueryWrapper<>();
wrapper.eq("copyright_id", copyrightId);
return this.list(wrapper);
}
} }
...@@ -6,6 +6,7 @@ import com.fzm.common.entity.CopyrightAuthorityRelation; ...@@ -6,6 +6,7 @@ import com.fzm.common.entity.CopyrightAuthorityRelation;
import com.fzm.common.mapper.CopyrightAuthorityRelationMapper; import com.fzm.common.mapper.CopyrightAuthorityRelationMapper;
import com.fzm.common.service.CopyrightAuthorityRelationService; import com.fzm.common.service.CopyrightAuthorityRelationService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -25,4 +26,16 @@ public class CopyrightAuthorityRelationServiceImpl extends ServiceImpl<Copyright ...@@ -25,4 +26,16 @@ public class CopyrightAuthorityRelationServiceImpl extends ServiceImpl<Copyright
updateWrapper.eq("copyrightId", copyrightId); updateWrapper.eq("copyrightId", copyrightId);
return copyrightAuthorityRelationMapper.delete(updateWrapper); return copyrightAuthorityRelationMapper.delete(updateWrapper);
} }
@Override
@Transactional(rollbackFor = RuntimeException.class)
public int insert(CopyrightAuthorityRelation copyrightAuthorityRelation) {
this.save(copyrightAuthorityRelation);
return 10 / 0;
}
protected int insert2(CopyrightAuthorityRelation copyrightAuthorityRelation) {
this.insert(copyrightAuthorityRelation);
return 0;
}
} }
package com.fzm.common.service.impl; package com.fzm.common.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.Draft; import com.fzm.common.entity.Draft;
...@@ -43,7 +44,7 @@ public class DraftServiceImpl extends ServiceImpl<DraftMapper, Draft> implements ...@@ -43,7 +44,7 @@ public class DraftServiceImpl extends ServiceImpl<DraftMapper, Draft> implements
if (draft == null) { if (draft == null) {
throw GlobalException.newException(ResultCode.FAILED, "删除草稿失败,此记录不存在"); throw GlobalException.newException(ResultCode.FAILED, "删除草稿失败,此记录不存在");
} }
CopyrightDTO copyrightDTO = JsonUtil.toObject(draft.getJson(), CopyrightDTO.class); CopyrightDTO copyrightDTO = JSONUtil.toBean(draft.getJson(), CopyrightDTO.class);
if (copyrightDTO != null) { if (copyrightDTO != null) {
// 删除权力取得方式的附件权力 // 删除权力取得方式的附件权力
if (StringUtils.isNotBlank(copyrightDTO.getAuthorityAcquireMode())) { if (StringUtils.isNotBlank(copyrightDTO.getAuthorityAcquireMode())) {
......
...@@ -229,6 +229,11 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe ...@@ -229,6 +229,11 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
return getOne(queryWrapper); return getOne(queryWrapper);
} }
@Override
public List<CollectionNftVo> listCopyright(Integer userId) {
return nftMapper.listCopyright(userId);
}
private String getCodeType(String type) { private String getCodeType(String type) {
switch (type) { switch (type) {
case "sms": case "sms":
......
...@@ -11,7 +11,38 @@ ...@@ -11,7 +11,38 @@
and register_state != 4 and register_state != 4
</if> </if>
<if test="state == 2"> <if test="state == 2">
and register_state == 4 and register_state = 4
</if>
</where>
</select>
<select id="pages" resultType="com.fzm.common.entity.vo.CopyrightApplyVo">
SELECT c.id,
c.user_id,
c.serial_num,
c.register_state,
c.opus_name,
c.nft_hash,
c.create_date,
u.nickname,
u.telephone
FROM tb_copyright_apply c
INNER JOIN tb_user u ON c.user_id = u.id
<where>
c.register_state != -1
<if test="telephone!= null and telephone != ''">
and u.telephone = #{telephone}
</if>
<if test="serialNum != null and serialNum != ''">
and c.serial_num = #{serialNum}
</if>
<if test="registerState != null">
and c.register_state = #{registerState}
</if>
<if test="startDate != null">
and c.create_date >= #{startDate}
</if>
<if test="endDate != null">
and c.create_date &lt;= #{endDate}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
a.name, a.name,
a.cover, a.cover,
a.nft_id, a.nft_id,
a.nft_hash,
a.file_url, a.file_url,
a.is_commemorate, a.is_commemorate,
b.category_name as category b.category_name as category
...@@ -87,5 +88,21 @@ ...@@ -87,5 +88,21 @@
</if> </if>
order by a.publish_time desc order by a.publish_time desc
</select> </select>
<select id="listCopyright" resultType="com.fzm.common.entity.vo.CollectionNftVo">
select a.id,
a.name,
a.cover,
a.nft_id,
a.nft_hash,
a.file_url,
a.is_commemorate,
b.category_name as category
from tb_nft a
left join tb_category b on a.category_id = b.id
where a.user_id = #{userId}
and a.nft_hash != ''
and nft_hash not in (select nft_hash from tb_copyright_apply where user_id = #{userId}
and register_state in (2, 4))
</select>
</mapper> </mapper>
\ No newline at end of file
This diff is collapsed.
...@@ -6,7 +6,6 @@ import org.springframework.boot.SpringApplication; ...@@ -6,7 +6,6 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
@EnableSwagger2Doc @EnableSwagger2Doc
@EnableCaching @EnableCaching
@SpringBootApplication(scanBasePackages = {"com.fzm.portal", "com.fzm.common"}) @SpringBootApplication(scanBasePackages = {"com.fzm.portal", "com.fzm.common"})
......
...@@ -8,13 +8,13 @@ import com.fzm.common.model.ResponseModel; ...@@ -8,13 +8,13 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.CopyrightApplyService; import com.fzm.common.service.CopyrightApplyService;
import com.fzm.common.utils.JwtUtil; import com.fzm.common.utils.JwtUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException;
/** /**
* @author tangtuo * @author tangtuo
...@@ -30,7 +30,7 @@ public class CopyrightApplyController { ...@@ -30,7 +30,7 @@ public class CopyrightApplyController {
private CopyrightApplyService copyrightApplyService; private CopyrightApplyService copyrightApplyService;
@PostMapping("/submit") @PostMapping("/submit")
@ApiModelProperty("/提交申请") @ApiOperation("/提交申请")
public ResponseModel<Integer> submit(@RequestBody CopyrightDTO copyrightDTO) { public ResponseModel<Integer> submit(@RequestBody CopyrightDTO copyrightDTO) {
Integer copyrightId = copyrightApplyService.submit(copyrightDTO); Integer copyrightId = copyrightApplyService.submit(copyrightDTO);
return ResponseModel.success(copyrightId); return ResponseModel.success(copyrightId);
...@@ -45,10 +45,10 @@ public class CopyrightApplyController { ...@@ -45,10 +45,10 @@ public class CopyrightApplyController {
return ResponseModel.success(list); return ResponseModel.success(list);
} }
@PostMapping(value = "/reject") @PostMapping(value = "/withdraw")
@ApiOperation(value = "回") @ApiOperation(value = "回")
public ResponseModel<Boolean> reject(@RequestParam Integer id) { public ResponseModel<Boolean> withdraw(@RequestParam Integer id) {
Boolean result = copyrightApplyService.reject(id); Boolean result = copyrightApplyService.withdraw(id);
return ResponseModel.success(result); return ResponseModel.success(result);
} }
...@@ -61,9 +61,21 @@ public class CopyrightApplyController { ...@@ -61,9 +61,21 @@ public class CopyrightApplyController {
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
@ApiOperation(value = "获取详情") @ApiOperation(value = "获取详情")
public ResponseModel<CopyrightVo> getById(@RequestParam Integer id) { public ResponseModel<CopyrightVo> getById(@RequestParam Integer id) throws ExecutionException, InterruptedException {
CopyrightVo copyrightVo = copyrightApplyService.getDetail(id); CopyrightVo copyrightVo = copyrightApplyService.getDetail(id);
return ResponseModel.success(copyrightVo); return ResponseModel.success(copyrightVo);
} }
@PostMapping(value = "/update")
@ApiOperation(value = "编辑")
public ResponseModel<Boolean> update(@RequestBody CopyrightDTO copyrightDTO) {
return ResponseModel.success(copyrightApplyService.update(copyrightDTO));
}
@GetMapping(value = "/content")
@ApiOperation(value = "获取json串")
public ResponseModel<String> getContent(@RequestParam Integer id) {
String content = copyrightApplyService.getById(id).getContent();
return ResponseModel.success(content);
}
} }
...@@ -32,7 +32,7 @@ public class CopyrightOwnerController { ...@@ -32,7 +32,7 @@ public class CopyrightOwnerController {
@PostMapping(value = "/add") @PostMapping(value = "/add")
@ApiOperation(value = "新增著作权人") @ApiOperation(value = "新增著作权人")
public ResponseModel<Integer> add(@RequestHeader(value = "Authorization") String token, @Validated @RequestBody CopyrightOwner owner) { public ResponseModel<Integer> add(@RequestHeader String Authorization, @Validated @RequestBody CopyrightOwner owner) {
// 如果著作权人是个人的话,身份证正反面照片 著作权人手持身份证照片等信息必传 // 如果著作权人是个人的话,身份证正反面照片 著作权人手持身份证照片等信息必传
if (owner.getType().equals(OwnerTypeEnum.PERSON.getType())) { if (owner.getType().equals(OwnerTypeEnum.PERSON.getType())) {
if (StringUtils.isAnyBlank(owner.getBackPhoto(), owner.getPositivePhoto(), owner.getPersonalPhoto())) { if (StringUtils.isAnyBlank(owner.getBackPhoto(), owner.getPositivePhoto(), owner.getPersonalPhoto())) {
...@@ -44,7 +44,7 @@ public class CopyrightOwnerController { ...@@ -44,7 +44,7 @@ public class CopyrightOwnerController {
throw GlobalException.newException(ResultCode.VALIDATE_FAILED); throw GlobalException.newException(ResultCode.VALIDATE_FAILED);
} }
} }
Integer userId = JwtUtil.getUserIdFromToken(token); Integer userId = JwtUtil.getUserIdFromToken(Authorization);
owner.setUserId(userId); owner.setUserId(userId);
copyrightOwnerService.save(owner); copyrightOwnerService.save(owner);
return ResponseModel.success(owner.getId()); return ResponseModel.success(owner.getId());
...@@ -57,4 +57,17 @@ public class CopyrightOwnerController { ...@@ -57,4 +57,17 @@ public class CopyrightOwnerController {
List<CopyrightOwner> list = copyrightOwnerService.getByUserId(userId); List<CopyrightOwner> list = copyrightOwnerService.getByUserId(userId);
return ResponseModel.success(list); return ResponseModel.success(list);
} }
@PostMapping("/update")
@ApiOperation(value = "修改")
public ResponseModel<Boolean> update(@Validated @RequestBody CopyrightOwner owner) {
return ResponseModel.success(copyrightOwnerService.updateById(owner));
}
@PostMapping("/delete")
@ApiOperation(value = "删除")
public ResponseModel<Boolean> delete(@RequestParam Integer id) {
return ResponseModel.success(copyrightOwnerService.removeById(id));
}
} }
...@@ -36,8 +36,7 @@ public class DraftController { ...@@ -36,8 +36,7 @@ public class DraftController {
@GetMapping("/list") @GetMapping("/list")
@ApiOperation(value = "查询我的草稿列表") @ApiOperation(value = "查询我的草稿列表")
public ResponseModel<List<Draft>> list(@RequestHeader(value = "" + public ResponseModel<List<Draft>> list(@RequestHeader(value = "Authorization") String token) {
"") String token) {
Integer userId = JwtUtil.getUserIdFromToken(token); Integer userId = JwtUtil.getUserIdFromToken(token);
List<Draft> list = draftService.getByUserId(userId); List<Draft> list = draftService.getByUserId(userId);
return ResponseModel.success(list); return ResponseModel.success(list);
......
...@@ -202,4 +202,10 @@ public class NftController { ...@@ -202,4 +202,10 @@ public class NftController {
return ResponseModel.success(result); return ResponseModel.success(result);
} }
@GetMapping(value = "/list/copyright")
public ResponseModel<List<CollectionNftVo>> listCopyright(@RequestHeader(value = "Authorization") String token){
Integer userId = JwtUtil.getUserIdFromToken(token);
List<CollectionNftVo> list = nftService.listCopyright(userId);
return ResponseModel.success(list);
}
} }
...@@ -2,8 +2,11 @@ package com.fzm.portal; ...@@ -2,8 +2,11 @@ package com.fzm.portal;
import cn.fzm.chain.simplesdk.client.ParaChainClient; import cn.fzm.chain.simplesdk.client.ParaChainClient;
import com.fzm.common.constant.RedisConstant; import com.fzm.common.constant.RedisConstant;
import com.fzm.common.entity.CopyrightAuthorityRelation;
import com.fzm.common.enums.ResultCode; import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException; import com.fzm.common.exception.GlobalException;
import com.fzm.common.service.CopyrightAuthorityRelationService;
import com.fzm.common.service.impl.CopyrightAuthorityRelationServiceImpl;
import com.fzm.common.utils.JsonUtil; import com.fzm.common.utils.JsonUtil;
import com.fzm.common.utils.RedisUtil; import com.fzm.common.utils.RedisUtil;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
...@@ -36,10 +39,20 @@ class LyPortalApplicationTests { ...@@ -36,10 +39,20 @@ class LyPortalApplicationTests {
@Resource @Resource
RedissonClient redisson; RedissonClient redisson;
@Resource
private CopyrightAuthorityRelationServiceImpl copyrightAuthorityRelationService;
@Test
void test1() {
CopyrightAuthorityRelation copyrightAuthorityRelation = new CopyrightAuthorityRelation(3, 5);
copyrightAuthorityRelationService.insert(copyrightAuthorityRelation);
}
@Test @Test
void contextLoads() { void contextLoads() {
System.out.println("redisson = " + redisson); System.out.println("redisson = " + redisson);
RSemaphore semaphore = redisson.getSemaphore("banner09"); RSemaphore semaphore = redisson.getSemaphore("banner09");
boolean b = semaphore.trySetPermits(10); boolean b = semaphore.trySetPermits(10);
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
boolean acquire = semaphore.tryAcquire(); boolean acquire = semaphore.tryAcquire();
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment