Commit 85fe7891 authored by wuwz's avatar wuwz

增加评论标签

parent ec506e95
...@@ -16,7 +16,7 @@ spring: ...@@ -16,7 +16,7 @@ spring:
cloud: cloud:
nacos: nacos:
config: config:
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8849
#共用配置,暂定一个 #共用配置,暂定一个
shared-dataids: common-dev.yaml,mongodb-log-dev.yaml shared-dataids: common-dev.yaml,mongodb-log-dev.yaml
namespace: chw_spcloud namespace: chw_spcloud
......
package com.github.wxiaoqi.security.admin.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/23 16:27
*/
@Data
public class AppraiseLabeInfoDTO extends PageParam {
private String name;
private Integer type;
private Integer enable;
}
package com.github.wxiaoqi.security.admin.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 评价标签
*
* @author wuweizhi
* @email 18178966185@163.com
* @date 2020-11-16 14:07:35
*/
@Data
@Table(name = "appraise_label_info")
public class AppraiseLabelInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("")
private Integer id;
/**
* 标签名称
*/
@Column(name = "name")
@ApiModelProperty(value = "标签名称")
private String name;
/**
* 分值
*/
@Column(name = "point")
@ApiModelProperty(value = "分值")
private Integer point;
/**
* 1-全部,2-房车,3-机车,4-游艇,5豪车
*/
@Column(name = "type")
@ApiModelProperty(value = "1-全部,2-房车,3-机车,4-游艇,5豪车")
private Integer type;
/**
* 是否启用:0、否,1、是
*/
@Column(name = "enable")
@ApiModelProperty(value = "是否启用:0、否,1、是")
private Integer enable;
/**
* 是否删除:0、否,1、是
*/
@Column(name = "is_del")
@ApiModelProperty(value = "是否删除:0、否,1、是")
private Integer isDel;
/**
*
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "", hidden = true )
private Long crtTime;
/**
*
*/
@Column(name = "upd_time")
@ApiModelProperty(value = "", hidden = true )
private Long updTime;
/**
* 规则:[{"star":1,"point":20,"level":"一般"}]
*/
@Column(name = "rules")
@ApiModelProperty(value = "规则:[{\"star\":1,\"point\":20,\"level\":\"一般\"}]")
private String rules;
/**
* 排序
*/
@Column(name = "sort")
@ApiModelProperty(value = "排序")
private Integer sort;
}
package com.github.wxiaoqi.security.admin.biz;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.dto.AppraiseLabeInfoDTO;
import com.github.wxiaoqi.security.admin.dto.CompanyApplyFindDTO;
import com.github.wxiaoqi.security.admin.entity.CompanyInfo;
import com.github.wxiaoqi.security.admin.vo.CompanyApplyVo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.github.wxiaoqi.security.admin.entity.AppraiseLabelInfo;
import com.github.wxiaoqi.security.admin.mapper.AppraiseLabelInfoMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 评价标签
*
* @author wuweizhi
* @email 18178966185@163.com
* @date 2020-11-16 14:07:35
*/
@Service
@Slf4j
@Transactional
public class AppraiseLabelInfoBiz extends BaseBiz<AppraiseLabelInfoMapper, AppraiseLabelInfo> {
public List<AppraiseLabelInfo> getList(AppraiseLabeInfoDTO appraiseLabeInfoDTO){
return mapper.selectList(appraiseLabeInfoDTO);
}
public ObjectRestResponse selectList(AppraiseLabeInfoDTO appraiseLabeInfoDTO){
PageHelper.startPage(appraiseLabeInfoDTO.getPage(), appraiseLabeInfoDTO.getLimit());
PageInfo<AppraiseLabelInfo> pageInfo = new PageInfo<>(getList(appraiseLabeInfoDTO));
return ObjectRestResponse.succ(PageDataVO.pageInfo(pageInfo));
}
public void saveOrUpd(AppraiseLabelInfo appraiseLabelInfo){
Long id = appraiseLabelInfo.getId() == null ? 0L :appraiseLabelInfo.getId();
if (id > 0L ){
updateSelectiveById(appraiseLabelInfo);
}else {
insertSelective(appraiseLabelInfo);
}
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.dto.AppraiseLabeInfoDTO;
import com.github.wxiaoqi.security.admin.dto.CompanyApplyFindDTO;
import com.github.wxiaoqi.security.admin.entity.AppraiseLabelInfo;
import com.github.wxiaoqi.security.admin.vo.CompanyApplyVo;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 评价标签
*
* @author wuweizhi
* @email 18178966185@163.com
* @date 2020-11-16 14:07:35
*/
public interface AppraiseLabelInfoMapper extends Mapper<AppraiseLabelInfo> {
List<AppraiseLabelInfo> selectList(AppraiseLabeInfoDTO appraiseLabeInfoDTO);
}
package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.admin.biz.AppraiseLabelInfoBiz;
import com.github.wxiaoqi.security.admin.entity.AppraiseLabelInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("app/appraiseLabelInfo")
public class AppraiseLabelInfoController extends BaseController<AppraiseLabelInfoBiz, AppraiseLabelInfo> {
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.rest.admin;
import com.github.wxiaoqi.security.admin.biz.AppraiseLabelInfoBiz;
import com.github.wxiaoqi.security.admin.dto.AppraiseLabeInfoDTO;
import com.github.wxiaoqi.security.admin.dto.CompanyApplyFindDTO;
import com.github.wxiaoqi.security.admin.entity.AppraiseLabelInfo;
import com.github.wxiaoqi.security.admin.entity.CompanyInfo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("backstage/appraiseLabelInfo")
public class AdminAppraiseLabelInfoController extends BaseController<AppraiseLabelInfoBiz, AppraiseLabelInfo> {
@GetMapping("tag/selectList")
@ApiModelProperty("标签列表")
public ObjectRestResponse applySelectList(AppraiseLabeInfoDTO appraiseLabeInfoDTO) {
return baseBiz.selectList(appraiseLabeInfoDTO);
}
@PostMapping("tag/upd")
@ApiModelProperty("修改标签")
public ObjectRestResponse upd(@RequestBody AppraiseLabelInfo appraiseLabelInfo) {
baseBiz.saveOrUpd(appraiseLabelInfo);
return ObjectRestResponse.succ();
}
}
\ No newline at end of file
<?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.github.wxiaoqi.security.admin.mapper.AppraiseLabelInfoMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.github.wxiaoqi.security.admin.entity.AppraiseLabelInfo" id="appraiseLabelInfoMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="point" column="point"/>
<result property="type" column="type"/>
<result property="enable" column="enable"/>
<result property="isDel" column="is_del"/>
<result property="crtTime" column="crt_time"/>
<result property="updTime" column="upd_time"/>
<result property="rules" column="rules"/>
<result property="sort" column="sort"/>
</resultMap>
<select id="selectList" resultType="com.github.wxiaoqi.security.admin.entity.AppraiseLabelInfo" parameterType="com.github.wxiaoqi.security.admin.dto.AppraiseLabeInfoDTO">
SELECT
*
FROM appraise_label_info a
where a.is_del = 0
<if test="name != null and name != ''">
AND ( a.`name` like concat('%',#{name},'%'))
</if>
<if test="type != null ">
AND a.`type`= #{type}
</if>
<if test="enable != null">
AND a.enable = #{enable}
</if>
order by a.upd_time DESC
</select>
</mapper>
\ No newline at end of file
...@@ -54,7 +54,7 @@ public class AccessTokenService { ...@@ -54,7 +54,7 @@ public class AccessTokenService {
{ {
JSONObject obj = JSONObject.parseObject(accessTokenRedis).getJSONObject(wy_appid); JSONObject obj = JSONObject.parseObject(accessTokenRedis).getJSONObject(wy_appid);
AccessToken accessToken = new AccessToken(obj.getString("json"),obj.getString("accessToken"),obj.getInteger("expiresIn"),obj.getLong("expiredTime")); AccessToken accessToken = new AccessToken(obj.getString("json"),obj.getString("accessToken"),obj.getInteger("expiresIn"),obj.getLong("expiredTime"));
if(null != accessToken && accessToken.isAvailable()){ if(accessToken.isAvailable()){
return accessToken; return accessToken;
} }
summbitRedisTemplate.delete(wy_appid); summbitRedisTemplate.delete(wy_appid);
......
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