Commit 03f0128d authored by shiyu's avatar shiyu

藏品详情新增标签

parent 8799a5d0
......@@ -45,6 +45,11 @@ public interface CommConsts {
*/
public static final String DEFAULT_AVATAR_URL = "https://cdn.wanwudezhi.com/mall-portal/image/4337400862";
/**
* 系统默认用户背景URL
*/
public static final String DEFAULT_BACKGROUND_URL = "https://cdn.wanwudezhi.com/static/web-static/image/1c679aa4e27789e491c070d52577efb1_1125x480.png";
}
package com.wwdz.ch.core.entity;
import com.wwdz.ch.db.domain.distribution.CollectionItemsRelation;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
......@@ -232,7 +233,7 @@ public class SupplierItemVo implements Entity {
/**
* 商品所属标签id
*/
private List<Long> bookIdList;
private List<CollectionItemsRelation> bookIdList;
/**
* 商家自购价
......
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.BidRecord;
import com.wwdz.ch.db.domain.CollectionBookSort;
public interface CollectionBookSortDao {
int add(CollectionBookSort collectionBookSort);
int update(long userId, String sortInfo);
CollectionBookSort find(long userId);
boolean isExisted(long userId);
}
package com.wwdz.ch.db.dao;
public interface CollectorWhiteListDao {
boolean isExisted(long collectorId);
}
package com.wwdz.ch.db.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/04/09
*/
@Data
public class CollectionBookSort implements Entity {
private Integer id;
/**
* 用户id
*/
private Long userId;
/**
* 收藏标签顺序,逗号分隔
*/
private String sortInfo;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", sortInfo=").append(sortInfo);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CollectionBookSort other = (CollectionBookSort) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getSortInfo() == null ? other.getSortInfo() == null : this.getSortInfo().equals(other.getSortInfo()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getSortInfo() == null) ? 0 : getSortInfo().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
userId("user_id", "userId", "BIGINT", false),
sortInfo("sort_info", "sortInfo", "LONGVARCHAR", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/04/09
*/
@Data
public class CollectorWhiteList implements Entity {
private Integer id;
/**
* 藏家id
*/
private Long collectorId;
/**
* 创建时间
*/
private Date createTime;
/**
* 是否有效
*/
private Boolean isValid;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", collectorId=").append(collectorId);
sb.append(", createTime=").append(createTime);
sb.append(", isValid=").append(isValid);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CollectorWhiteList other = (CollectorWhiteList) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCollectorId() == null ? other.getCollectorId() == null : this.getCollectorId().equals(other.getCollectorId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCollectorId() == null) ? 0 : getCollectorId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
collectorId("collector_id", "collectorId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
isValid("is_valid", "isValid", "BIT", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
......@@ -52,4 +52,9 @@ public class CollectionBookRequestDto extends BaseRequestDto implements Entity
* 分享id
*/
private String shareRecordId;
/**
* 排序信息
*/
private String sortInfo;
}
package com.wwdz.ch.db.impl;
import com.wwdz.ch.db.dao.CollectionBookSortDao;
import com.wwdz.ch.db.domain.CollectionBookSort;
import com.wwdz.ch.db.domain.CollectionBookSortExample;
import com.wwdz.ch.db.mapper.CollectionBookSortMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class CollectionBookSortDaoImpl implements CollectionBookSortDao {
@Autowired
CollectionBookSortMapper collectionBookSortMapper;
@Override
public int add(CollectionBookSort collectionBookSort) {
return collectionBookSortMapper.insert(collectionBookSort);
}
@Override
public int update(long userId, String sortInfo) {
CollectionBookSort collectionBookSort = new CollectionBookSort();
collectionBookSort.setSortInfo(sortInfo);
CollectionBookSortExample example = new CollectionBookSortExample();
CollectionBookSortExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
return collectionBookSortMapper.updateByExampleSelective(collectionBookSort, example);
}
@Override
public CollectionBookSort find(long userId) {
CollectionBookSortExample example = new CollectionBookSortExample();
CollectionBookSortExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
return collectionBookSortMapper.selectOneByExampleWithBLOBs(example);
}
@Override
public boolean isExisted(long userId) {
CollectionBookSortExample example = new CollectionBookSortExample();
CollectionBookSortExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
return collectionBookSortMapper.countByExample(example) > 0;
}
}
package com.wwdz.ch.db.impl;
import com.wwdz.ch.db.dao.CollectorWhiteListDao;
import com.wwdz.ch.db.domain.CollectorWhiteListExample;
import com.wwdz.ch.db.mapper.CollectorWhiteListMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class CollectorWhiteListDaoImpl implements CollectorWhiteListDao {
@Autowired
CollectorWhiteListMapper collectorWhiteListMapper;
@Override
public boolean isExisted(long collectorId) {
CollectorWhiteListExample example = new CollectorWhiteListExample();
CollectorWhiteListExample.Criteria criteria = example.createCriteria();
criteria.andCollectorIdEqualTo(collectorId);
criteria.andIsValidEqualTo(true);
return collectorWhiteListMapper.countByExample(example) > 0;
}
}
package com.wwdz.ch.db.mapper;
import com.wwdz.ch.db.domain.CollectionBookSort;
import com.wwdz.ch.db.domain.CollectionBookSortExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface CollectionBookSortMapper {
long countByExample(CollectionBookSortExample example);
int deleteByExample(CollectionBookSortExample example);
int deleteByPrimaryKey(Integer id);
int insert(CollectionBookSort record);
int insertSelective(CollectionBookSort record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionBookSort selectOneByExample(CollectionBookSortExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionBookSort selectOneByExampleSelective(@Param("example") CollectionBookSortExample example, @Param("selective") CollectionBookSort.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionBookSort selectOneByExampleWithBLOBs(CollectionBookSortExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<CollectionBookSort> selectByExampleSelective(@Param("example") CollectionBookSortExample example, @Param("selective") CollectionBookSort.Column ... selective);
List<CollectionBookSort> selectByExampleWithBLOBs(CollectionBookSortExample example);
List<CollectionBookSort> selectByExample(CollectionBookSortExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collection_book_sort
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectionBookSort selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") CollectionBookSort.Column ... selective);
CollectionBookSort selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") CollectionBookSort record, @Param("example") CollectionBookSortExample example);
int updateByExampleWithBLOBs(@Param("record") CollectionBookSort record, @Param("example") CollectionBookSortExample example);
int updateByExample(@Param("record") CollectionBookSort record, @Param("example") CollectionBookSortExample example);
int updateByPrimaryKeySelective(CollectionBookSort record);
int updateByPrimaryKeyWithBLOBs(CollectionBookSort record);
int updateByPrimaryKey(CollectionBookSort record);
}
\ No newline at end of file
package com.wwdz.ch.db.mapper;
import com.wwdz.ch.db.domain.CollectorWhiteList;
import com.wwdz.ch.db.domain.CollectorWhiteListExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface CollectorWhiteListMapper {
long countByExample(CollectorWhiteListExample example);
int deleteByExample(CollectorWhiteListExample example);
int deleteByPrimaryKey(Integer id);
int insert(CollectorWhiteList record);
int insertSelective(CollectorWhiteList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectorWhiteList selectOneByExample(CollectorWhiteListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectorWhiteList selectOneByExampleSelective(@Param("example") CollectorWhiteListExample example, @Param("selective") CollectorWhiteList.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<CollectorWhiteList> selectByExampleSelective(@Param("example") CollectorWhiteListExample example, @Param("selective") CollectorWhiteList.Column ... selective);
List<CollectorWhiteList> selectByExample(CollectorWhiteListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table collector_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
CollectorWhiteList selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") CollectorWhiteList.Column ... selective);
CollectorWhiteList selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") CollectorWhiteList record, @Param("example") CollectorWhiteListExample example);
int updateByExample(@Param("record") CollectorWhiteList record, @Param("example") CollectorWhiteListExample example);
int updateByPrimaryKeySelective(CollectorWhiteList record);
int updateByPrimaryKey(CollectorWhiteList record);
}
\ No newline at end of file
package com.wwdz.ch.wx.constant;
/**
* 藏家默认展示的标签
*/
public class CollectionBookConstants {
private String saleing;
}
......@@ -162,8 +162,13 @@ public class UserServiceImpl implements UserService {
result.put("token", dto.getToken());
result.put("tokenExpire", userToken.getExpireTime().toString());
result.put("isInvited", true);
User user = userDao.queryById(dto.getUserId());
logger.info("登录用户的信息:{}", JsonUtils.from(user));
CloudServerResponse<com.wwdz.user.api.model.user.User> userCloudServerResponse = userReadService.getUserIsNotDelete(dto.getUserId());
if (userCloudServerResponse.getCode() != 1001) {
return Result.failed("用户信息初始化失败");
}
com.wwdz.user.api.model.user.User wUser = userCloudServerResponse.getResult();
User user = User.of(wUser);
logger.info(">>>>>>> 登录用户的信息:{}", JsonUtils.from(user));
String phone = user.getMobile();
//如果用户手机号为空,则调用微信接口查询出手机号进行保存
......
......@@ -2,9 +2,11 @@ package com.wwdz.ch.wx.impl.distribution;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.CollectionBookSortDao;
import com.wwdz.ch.db.dao.distribution.CollectionBookDao;
import com.wwdz.ch.db.dao.distribution.CollectionItemsRelationDao;
import com.wwdz.ch.db.dao.distribution.CollectionShareRecordDao;
import com.wwdz.ch.db.domain.CollectionBookSort;
import com.wwdz.ch.db.domain.distribution.CollectionBook;
import com.wwdz.ch.db.domain.distribution.CollectionShareRecord;
import com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto;
......@@ -33,6 +35,9 @@ public class CollectionBookServiceImpl implements CollectionBookService {
@Autowired
CollectionShareRecordDao collectionShareRecordDao;
@Autowired
CollectionBookSortDao collectionBookSortDao;
@Override
public Result create(CollectionBookRequestDto dto) {
try {
......@@ -127,6 +132,21 @@ public class CollectionBookServiceImpl implements CollectionBookService {
}
@Override
public Result updateSort(CollectionBookRequestDto dto) {
try {
if (!collectionBookSortDao.isExisted(dto.getUserId())) {
CollectionBookSort collectionBookSort = new CollectionBookSort();
collectionBookSort.setUserId(dto.getUserId());
collectionBookSort.setSortInfo(dto.getSortInfo());
collectionBookSortDao.add(collectionBookSort);
} else {
collectionBookSortDao.update(dto.getUserId(), dto.getSortInfo());
}
return Result.success();
} catch (Exception e) {
logger.error("标签顺序修改 error: {}", e);
}
return Result.failed();
}
}
......@@ -7,6 +7,7 @@ import com.wwdz.ch.core.util.CacheUtil;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.core.util.RedisUtils;
import com.wwdz.ch.db.bean.DistributionOrderNum;
import com.wwdz.ch.db.dao.FollowFansRecordDao;
import com.wwdz.ch.db.dao.SwitchDao;
import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.domain.User;
......@@ -68,6 +69,9 @@ public class SelfPageServiceImpl implements SelfPageService {
@Autowired
SwitchDao switchDao;
@Autowired
FollowFansRecordDao followFansRecordDao;
@Override
......@@ -179,6 +183,11 @@ public class SelfPageServiceImpl implements SelfPageService {
User user = cacheUtil.getAppletUserById(itemUserId);
map.put("avatar", StringUtils.isEmpty(user.getAvatar()) ? CommConsts.DEFAULT_AVATAR_URL : user.getAvatar());
map.put("name", StringUtils.isEmpty(user.getNickname()) ? "微信用户" : user.getNickname());
map.put("background", StringUtils.isEmpty(user.getBackground()) ? CommConsts.DEFAULT_BACKGROUND_URL : user.getBackground());
map.put("profile", user.getProfile());
long fansNum = followFansRecordDao.countFans(itemUserId);
map.put("fansNum", fansNum);
map.put("targetUserId", itemUserId);
long count = supplierItemDao.countByCreatorId(itemUserId);
map.put("count", count);
return Result.success(map);
......
......@@ -702,8 +702,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemVo.setCollectedNum((int) countNum);
//查询商品所属标签
List<CollectionItemsRelation> collectionItemsRelations = collectionItemsRelationDao.findByItemId(itemId);
List<Long> bookIds = collectionItemsRelations.stream().map(CollectionItemsRelation::getCollectionBookId).collect(Collectors.toList());
supplierItemVo.setBookIdList(bookIds);
supplierItemVo.setBookIdList(collectionItemsRelations);
return Result.success(supplierItemVo);
} catch (Exception e) {
logger.error("查询上传的藏品详情 error : {}", e);
......
......@@ -35,4 +35,11 @@ public interface CollectionBookService {
* @return
*/
Result delete(CollectionBookRequestDto dto);
/**
* 标签排序
* @param dto
* @return
*/
Result updateSort(CollectionBookRequestDto dto);
}
......@@ -5,6 +5,7 @@ import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto;
import com.wwdz.ch.wx.service.distribution.CollectionBookService;
import com.xxdxxs.utils.StringUtils;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -64,4 +65,15 @@ public class CollectionBookController {
}
return collectionBookService.delete(dto);
}
@ApiOperation(value = "藏品标签排序")
@PostMapping("/updateSort")
public Result updateSort(@RequestBody CollectionBookRequestDto dto) {
logger.info("藏品标签排序,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null || StringUtils.isEmpty(dto.getSortInfo())) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return collectionBookService.updateSort(dto);
}
}
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