🎨 style(entity,dto,service,...): 实体等pojo主键变为Long类型

This commit is contained in:
ronger 2022-07-25 06:43:13 +08:00
parent 15e82e3ded
commit 35cc83ec00
37 changed files with 105 additions and 59 deletions

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -8,7 +9,8 @@ import lombok.Data;
@Data
public class ChangeEmailDTO {
private Integer idUser;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String email;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -8,7 +9,8 @@ import lombok.Data;
@Data
public class UpdatePasswordDTO {
private Integer idUser;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String password;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto.admin;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -8,7 +9,9 @@ import lombok.Data;
@Data
public class TopicTagDTO {
private Integer idTopic;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTopic;
private Integer idTag;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTag;
}

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto.admin;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
@ -7,7 +8,10 @@ import lombok.Data;
*/
@Data
public class UserRoleDTO {
private Integer idUser;
private Integer idRole;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idRole;
}

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -18,7 +19,8 @@ public class ArticleContent {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idArticle;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
private String articleContent;

View File

@ -22,11 +22,13 @@ public class ArticleThumbsUp implements Serializable, Cloneable {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idArticleThumbsUp;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticleThumbsUp;
/**
* 文章表主键
*/
private Integer idArticle;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
/**
* 用户表主键
*/

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -21,15 +22,17 @@ public class Bank {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idBank;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idBank;
/** 银行名称 */
private String bankName;
/** 银行负责人 */
private Integer bankOwner;
private Long bankOwner;
/** 银行描述 */
private String bankDescription;
/** 创建人 */
private Integer createdBy;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long createdBy;
/** 创建时间 */
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;

View File

@ -22,9 +22,11 @@ public class BankAccount {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idBankAccount;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idBankAccount;
/** 所属银行 */
private Integer idBank;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idBank;
/** 银行账户 */
private String bankAccount;
/** 账户余额 */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.GeneratedValue;
@ -18,11 +19,13 @@ public class CurrencyIssue {
/** 主键 */
@Id
@GeneratedValue(generator = "JDBC")
private Integer id;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/** 发行数额 */
private BigDecimal issueValue;
/** 发行人 */
private Integer createdBy;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long createdBy;
/** 发行时间 */
private Date createdTime;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -21,7 +22,8 @@ public class CurrencyRule implements Serializable, Cloneable {
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
private Integer idCurrencyRule;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idCurrencyRule;
/**
* 规则名称
*/

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import tk.mybatis.mapper.annotation.ColumnType;
@ -19,7 +20,8 @@ public class Permission implements Serializable,Cloneable {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idPermission;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idPermission;
/**
* 权限标识

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -26,7 +27,8 @@ public class Product implements Serializable, Cloneable {
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "id")
private Integer idProduct;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idProduct;
/**
* 产品名
*/

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Table;
@ -20,7 +21,8 @@ public class ProductContent implements Serializable, Cloneable {
/**
* 产品表主键
*/
private Integer idProduct;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idProduct;
/**
* 产品详情原文
*/

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -19,7 +20,8 @@ public class Role implements Serializable,Cloneable {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idRole;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idRole;
/**
* 角色名称

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -19,7 +20,8 @@ public class SpecialDay implements Serializable,Cloneable{
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idSpecialDay;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idSpecialDay;
/** 名称 */
private String specialDayName;
/** 权重/优先级,小数优秀 */

View File

@ -21,7 +21,8 @@ public class Sponsor implements Serializable, Cloneable {
*/
@Id
@GeneratedValue(generator = "JDBC")
private Integer id;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/**
* 数据类型
*/

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -19,7 +20,8 @@ public class Tag implements Serializable,Cloneable {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idTag;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTag;
/** 标签名 */
private String tagTitle;
/** 标签图标 */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -19,7 +20,8 @@ public class Topic {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idTopic;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTopic;
/** 专题标题 */
private String topicTitle;
/** 专题路径 */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -20,7 +21,8 @@ public class TransactionRecord {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idTransactionRecord;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idTransactionRecord;
/** 交易流水号 */
private String transactionNo;
/** 款项 */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Id;
@ -13,6 +14,7 @@ import javax.persistence.Table;
public class UserExtend {
@Id
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String github;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
@ -17,7 +18,8 @@ public class WxUser {
@Id
@Column(name = "id")
@GeneratedValue(generator = "JDBC")
private Integer idWxUser;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idWxUser;
private Boolean subscribe;

View File

@ -14,5 +14,5 @@ public interface ArticleThumbsUpMapper extends Mapper<ArticleThumbsUp> {
* @param thumbsUpNumber
* @return
*/
Integer updateArticleThumbsUpNumber(@Param("idArticle") Integer idArticle, @Param("thumbsUpNumber") Integer thumbsUpNumber);
Integer updateArticleThumbsUpNumber(@Param("idArticle") Long idArticle, @Param("thumbsUpNumber") Integer thumbsUpNumber);
}

View File

@ -25,7 +25,7 @@ public interface BankAccountMapper extends Mapper<BankAccount> {
* @param idBank
* @return
*/
BankAccountDTO selectBankAccount(@Param("idBank") Integer idBank);
BankAccountDTO selectBankAccount(@Param("idBank") Long idBank);
/**
* 获取当前最大卡号

View File

@ -8,5 +8,5 @@ import java.util.List;
public interface PermissionMapper extends Mapper<Permission> {
List<Permission> selectMenuByIdRole(@Param("role") Integer role);
List<Permission> selectMenuByIdRole(@Param("role") Long role);
}

View File

@ -12,7 +12,7 @@ public interface RoleMapper extends Mapper<Role> {
Role selectRoleByInputCode(@Param("inputCode") String inputCode);
Integer updateStatus(@Param("idRole") Integer idRole, @Param("status") String status);
Integer updateStatus(@Param("idRole") Long idRole, @Param("status") String status);
Integer update(@Param("idRole") Integer idRole, @Param("name") String name, @Param("inputCode") String inputCode, @Param("weights") Integer weights);
Integer update(@Param("idRole") Long idRole, @Param("name") String name, @Param("inputCode") String inputCode, @Param("weights") Integer weights);
}

View File

@ -18,7 +18,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param idArticle
* @return
*/
Integer insertTagArticle(@Param("idTag") Integer idTag, @Param("idArticle") Long idArticle);
Integer insertTagArticle(@Param("idTag") Long idTag, @Param("idArticle") Long idArticle);
/**
* 统计标签使用数(文章)
@ -26,7 +26,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param idArticle
* @return
*/
Integer selectCountTagArticleById(@Param("idTag") Integer idTag, @Param("idArticle") Long idArticle);
Integer selectCountTagArticleById(@Param("idTag") Long idTag, @Param("idArticle") Long idArticle);
/**
* 获取用户标签数
@ -34,7 +34,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param idTag
* @return
*/
Integer selectCountUserTagById(@Param("idUser") Long idUser, @Param("idTag") Integer idTag);
Integer selectCountUserTagById(@Param("idUser") Long idUser, @Param("idTag") Long idTag);
/**
* 插入用户标签信息
@ -43,7 +43,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param type
* @return
*/
Integer insertUserTag(@Param("idTag") Integer idTag, @Param("idUser") Long idUser, @Param("type") Integer type);
Integer insertUserTag(@Param("idTag") Long idTag, @Param("idUser") Long idUser, @Param("type") Integer type);
/**
* 删除未使用标签
@ -61,7 +61,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param tagReservation
* @return
*/
Integer update(@Param("idTag") Integer idTag, @Param("tagUri") String tagUri, @Param("tagIconPath") String tagIconPath, @Param("tagStatus") String tagStatus, @Param("tagDescription") String tagDescription, @Param("tagReservation") String tagReservation);
Integer update(@Param("idTag") Long idTag, @Param("tagUri") String tagUri, @Param("tagIconPath") String tagIconPath, @Param("tagStatus") String tagStatus, @Param("tagDescription") String tagDescription, @Param("tagReservation") String tagReservation);
/**
* 查询标签列表

View File

@ -44,21 +44,21 @@ public interface TopicMapper extends Mapper<Topic> {
* @param topicDescriptionHtml
* @return
*/
Integer update(@Param("idTopic") Integer idTopic, @Param("topicTitle") String topicTitle, @Param("topicUri") String topicUri, @Param("topicIconPath") String topicIconPath, @Param("topicNva") String topicNva, @Param("topicStatus") String topicStatus, @Param("topicSort") Integer topicSort, @Param("topicDescription") String topicDescription, @Param("topicDescriptionHtml") String topicDescriptionHtml);
Integer update(@Param("idTopic") Long idTopic, @Param("topicTitle") String topicTitle, @Param("topicUri") String topicUri, @Param("topicIconPath") String topicIconPath, @Param("topicNva") String topicNva, @Param("topicStatus") String topicStatus, @Param("topicSort") Integer topicSort, @Param("topicDescription") String topicDescription, @Param("topicDescriptionHtml") String topicDescriptionHtml);
/**
* @param idTopic
* @param tagTitle
* @return
*/
List<Tag> selectUnbindTagsById(@Param("idTopic") Integer idTopic, @Param("tagTitle") String tagTitle);
List<Tag> selectUnbindTagsById(@Param("idTopic") Long idTopic, @Param("tagTitle") String tagTitle);
Integer insertTopicTag(@Param("idTopic") Integer idTopic, @Param("idTag") Integer idTag);
Integer insertTopicTag(@Param("idTopic") Long idTopic, @Param("idTag") Long idTag);
/**
* @param idTopic
* @param idTag
* @return
*/
Integer deleteTopicTag(@Param("idTopic") Integer idTopic, @Param("idTag") Integer idTag);
Integer deleteTopicTag(@Param("idTopic") Long idTopic, @Param("idTag") Long idTag);
}

View File

@ -28,7 +28,7 @@ public interface UserMapper extends Mapper<User> {
* @param idRole
* @return
*/
Integer insertUserRole(@Param("idUser") Long idUser, @Param("idRole") Integer idRole);
Integer insertUserRole(@Param("idUser") Long idUser, @Param("idRole") Long idRole);
/**
* 根据账号获取获取用户信息
@ -65,7 +65,7 @@ public interface UserMapper extends Mapper<User> {
* @param idRole
* @return
*/
Integer updateUserRole(@Param("idUser") Integer idUser, @Param("idRole") Integer idRole);
Integer updateUserRole(@Param("idUser") Long idUser, @Param("idRole") Long idRole);
/**
* 更新用户状态
@ -87,7 +87,7 @@ public interface UserMapper extends Mapper<User> {
* @param idUser
* @return
*/
UserInfoDTO selectUserInfo(@Param("idUser") Integer idUser);
UserInfoDTO selectUserInfo(@Param("idUser") Long idUser);
/**
* 更新用户信息
@ -128,7 +128,7 @@ public interface UserMapper extends Mapper<User> {
* @param email
* @return
*/
Integer updateEmail(@Param("idUser") Integer idUser, @Param("email") String email);
Integer updateEmail(@Param("idUser") Long idUser, @Param("email") String email);
/**
* 更新密码
@ -136,7 +136,7 @@ public interface UserMapper extends Mapper<User> {
* @param password
* @return
*/
Integer updatePasswordById(@Param("idUser") Integer idUser, @Param("password") String password);
Integer updatePasswordById(@Param("idUser") Long idUser, @Param("password") String password);
/**
* 查询用户数据

View File

@ -35,7 +35,7 @@ public interface RoleService extends Service<Role> {
* @param status
* @return
* */
Map updateStatus(Integer idRole, String status);
Map updateStatus(Long idRole, String status);
/**
* 添加/更新角色

View File

@ -39,7 +39,7 @@ public interface TopicService extends Service<Topic> {
* @param tagTitle
* @return
*/
List<Tag> findUnbindTagsById(Integer idTopic, String tagTitle);
List<Tag> findUnbindTagsById(Long idTopic, String tagTitle);
/**
* 绑定标签

View File

@ -63,7 +63,7 @@ public interface UserService extends Service<User> {
* @param idRole 角色 id
* @return Map
* */
Map updateUserRole(Integer idUser, Integer idRole);
Map updateUserRole(Long idUser, Long idRole);
/**
* 更新用户状态
@ -78,7 +78,7 @@ public interface UserService extends Service<User> {
* @param idUser
* @return
*/
Map findUserInfo(Integer idUser);
Map findUserInfo(Long idUser);
/**
* 更新用户信息

View File

@ -49,7 +49,7 @@ public class BankAccountServiceImpl extends AbstractService<BankAccount> impleme
} else {
bankAccount.setAccountBalance(new BigDecimal("0"));
// 默认为社区发展与改革银行
bankAccount.setIdBank(2);
bankAccount.setIdBank(2L);
bankAccount.setBankAccount(nextBankAccount());
bankAccount.setCreatedTime(new Date());
bankAccountMapper.insertSelective(bankAccount);
@ -77,7 +77,7 @@ public class BankAccountServiceImpl extends AbstractService<BankAccount> impleme
@Override
public BankAccount findSystemBankAccount() {
BankAccount bankAccount = new BankAccount();
bankAccount.setIdBank(1);
bankAccount.setIdBank(1L);
bankAccount.setAccountType("1");
bankAccount.setAccountOwner(2L);
return bankAccountMapper.selectOne(bankAccount);

View File

@ -38,7 +38,7 @@ public class RoleServiceImpl extends AbstractService<Role> implements RoleServic
@Override
@Transactional
public Map updateStatus(Integer idRole, String status) {
public Map updateStatus(Long idRole, String status) {
Map map = new HashMap(1);
Integer result = roleMapper.updateStatus(idRole,status);
if(result == 0) {

View File

@ -101,7 +101,7 @@ public class TopicServiceImpl extends AbstractService<Topic> implements TopicSer
}
@Override
public List<Tag> findUnbindTagsById(Integer idTopic, String tagTitle) {
public List<Tag> findUnbindTagsById(Long idTopic, String tagTitle) {
if (StringUtils.isBlank(tagTitle)) {
tagTitle = "";
}

View File

@ -158,7 +158,7 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
@Override
@Transactional(rollbackFor = Exception.class)
public Map updateUserRole(Integer idUser, Integer idRole) {
public Map updateUserRole(Long idUser, Long idRole) {
Map map = new HashMap(2);
Integer result = userMapper.updateUserRole(idUser, idRole);
if (result == 0) {
@ -179,7 +179,7 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
}
@Override
public Map findUserInfo(Integer idUser) {
public Map findUserInfo(Long idUser) {
Map map = new HashMap(2);
UserInfoDTO user = userMapper.selectUserInfo(idUser);
if (user == null) {
@ -271,7 +271,7 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
public Map updateEmail(ChangeEmailDTO changeEmailDTO) {
Map map = new HashMap(2);
map.put("message", "验证码无效!");
Integer idUser = changeEmailDTO.getIdUser();
Long idUser = changeEmailDTO.getIdUser();
String email = changeEmailDTO.getEmail();
String code = changeEmailDTO.getCode();
String vCode = redisService.get(email);

View File

@ -129,7 +129,7 @@ public class AdminController {
@GetMapping("/topic/unbind-topic-tags")
public GlobalResult<PageInfo<Tag>> unbindTopicTags(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, HttpServletRequest request){
Integer idTopic = Integer.valueOf(request.getParameter("idTopic"));
Long idTopic = Long.valueOf(request.getParameter("idTopic"));
String tagTitle = request.getParameter("tagTitle");
PageHelper.startPage(page, rows);
List<Tag> list = topicService.findUnbindTagsById(idTopic, tagTitle);

View File

@ -34,7 +34,7 @@ public class UserInfoController {
@GetMapping("/detail/{idUser}")
@SecurityInterceptor
public GlobalResult detail(@PathVariable Integer idUser) {
public GlobalResult detail(@PathVariable Long idUser) {
Map map = userService.findUserInfo(idUser);
return GlobalResultGenerator.genSuccessResult(map);
}