提交 8c0a308a authored 作者: 张光耀's avatar 张光耀

添加了,版本更新

上级 83ac52ac
......@@ -44,6 +44,7 @@ public class TokenVerification {
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfFeedbackController.getFeedbackList(..))" +
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfUserInfoController.getUserIdentifyCode(..))"+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.GoodsTypeController.*(..))"+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.VersionController.*(..))"+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfFeeController.*(..))")
public void controllerAspect() {
......
package com.diaoyun.zion.chinafrica.controller;
import com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity;
import com.diaoyun.zion.chinafrica.service.TbCfVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/version")
public class VersionController {
@Autowired
private TbCfVersionService tbCfVersionService;
@RequestMapping("/getVersionCode")
@GetMapping
public Map<String, TbCfVersionEntity> getGoodsTypeList( @RequestParam(required = false) String code) {
Map<String,TbCfVersionEntity> map = new HashMap<>();
TbCfVersionEntity version = tbCfVersionService.getVersionCode(code);
map.put("data",version);
return map;
}
}
package com.diaoyun.zion.chinafrica.dao;
import com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity;
import com.diaoyun.zion.master.dao.BaseDao;
/**
* Dao
*
* @author lipengjun
* @date 2019-10-22 14:33:29
*/
public interface TbCfVersionDao extends BaseDao<TbCfVersionEntity> {
TbCfVersionEntity getVersionCode(String code);
}
package com.diaoyun.zion.chinafrica.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 实体
* 表名 tb_cf_version
*
* @author lipengjun
* @date 2019-10-22 14:33:29
*/
public class TbCfVersionEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 版本号Id
*/
private String versionId;
/**
* 版本code
*/
private String versionCode;
/**
* 版本更新链接
*/
private String versionLike;
/**
* 版本更新内容
*/
private String versionDetail;
/**
* 设置:版本号Id
*/
public void setVersionId(String versionId) {
this.versionId = versionId;
}
/**
* 获取:版本号Id
*/
public String getVersionId() {
return versionId;
}
/**
* 设置:版本code
*/
public void setVersionCode(String versionCode) {
this.versionCode = versionCode;
}
/**
* 获取:版本code
*/
public String getVersionCode() {
return versionCode;
}
/**
* 设置:版本更新链接
*/
public void setVersionLike(String versionLike) {
this.versionLike = versionLike;
}
/**
* 获取:版本更新链接
*/
public String getVersionLike() {
return versionLike;
}
/**
* 设置:版本更新内容
*/
public void setVersionDetail(String versionDetail) {
this.versionDetail = versionDetail;
}
/**
* 获取:版本更新内容
*/
public String getVersionDetail() {
return versionDetail;
}
}
package com.diaoyun.zion.chinafrica.service;
import com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity;
import java.util.List;
import java.util.Map;
/**
* Service接口
*
* @author lipengjun
* @date 2019-10-22 14:33:29
*/
public interface TbCfVersionService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfVersionEntity queryObject(String versionId);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<TbCfVersionEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param tbCfVersion 实体
* @return 保存条数
*/
int save(TbCfVersionEntity tbCfVersion);
/**
* 根据主键更新实体
*
* @param tbCfVersion 实体
* @return 更新条数
*/
int update(TbCfVersionEntity tbCfVersion);
/**
* 根据主键删除
*
* @param versionId
* @return 删除条数
*/
int delete(String versionId);
/**
* 根据主键批量删除
*
* @param versionIds
* @return 删除条数
*/
int deleteBatch(String[] versionIds);
TbCfVersionEntity getVersionCode(String code);
}
package com.diaoyun.zion.chinafrica.service.impl;
import com.diaoyun.zion.chinafrica.dao.TbCfVersionDao;
import com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity;
import com.diaoyun.zion.chinafrica.service.TbCfVersionService;
import com.diaoyun.zion.master.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* Service实现类
*
* @author lipengjun
* @date 2019-10-22 14:33:29
*/
@Service("tbCfVersionService")
public class TbCfVersionServiceImpl implements TbCfVersionService {
@Autowired
private TbCfVersionDao tbCfVersionDao;
@Override
public TbCfVersionEntity queryObject(String versionId) {
return tbCfVersionDao.queryObject(versionId);
}
@Override
public List<TbCfVersionEntity> queryList(Map<String, Object> map) {
return tbCfVersionDao.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return tbCfVersionDao.queryTotal(map);
}
@Override
public int save(TbCfVersionEntity tbCfVersion) {
tbCfVersion.setVersionId(IdUtil.createIdbyUUID());
return tbCfVersionDao.save(tbCfVersion);
}
@Override
public int update(TbCfVersionEntity tbCfVersion) {
return tbCfVersionDao.update(tbCfVersion);
}
@Override
public int delete(String versionId) {
return tbCfVersionDao.delete(versionId);
}
@Override
public int deleteBatch(String[] versionIds) {
return tbCfVersionDao.deleteBatch(versionIds);
}
@Override
public TbCfVersionEntity getVersionCode(String code) {
return tbCfVersionDao.getVersionCode(code);
}
}
<?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.diaoyun.zion.chinafrica.dao.TbCfVersionDao">
<resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity" id="tbCfVersionMap">
<result property="versionId" column="version_id"/>
<result property="versionCode" column="version_code"/>
<result property="versionLike" column="version_like"/>
<result property="versionDetail" column="version_detail"/>
</resultMap>
<select id="getVersionCode" resultType="com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity">
select
`version_id`,
`version_code`,
`version_like`,
`version_detail`
from tb_cf_version
where version_code = #{code}
</select>
<select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity">
select
`version_id`,
`version_code`,
`version_like`,
`version_detail`
from tb_cf_version
where version_id = #{id}
</select>
<select id="queryList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity">
select
`version_id`,
`version_code`,
`version_like`,
`version_detail`
from tb_cf_version
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by version_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_version
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity">
insert into tb_cf_version(
`version_id`,
`version_code`,
`version_like`,
`version_detail`)
values(
#{versionId},
#{versionCode},
#{versionLike},
#{versionDetail})
</insert>
<update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfVersionEntity">
update tb_cf_version
<set>
<if test="versionCode != null">`version_code` = #{versionCode}, </if>
<if test="versionLike != null">`version_like` = #{versionLike}, </if>
<if test="versionDetail != null">`version_detail` = #{versionDetail}</if>
</set>
where version_id = #{versionId}
</update>
<delete id="delete">
delete from tb_cf_version where version_id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_version where version_id in
<foreach item="versionId" collection="array" open="(" separator="," close=")">
#{versionId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -367,7 +367,7 @@ public class ZionApplicationTests {
*
* @param usableSibUrl
* @return
*/
private String deleteLoginModule(String usableSibUrl) {
usableSibUrl = usableSibUrl.replaceAll("couponActivity", "");
usableSibUrl = usableSibUrl.replaceAll("soldQuantity", "");
......@@ -378,8 +378,8 @@ public class ZionApplicationTests {
usableSibUrl = usableSibUrl.replaceAll("delivery", "");
return usableSibUrl;
}
*/
/*
//使用序列化的方式保存CookieStore到本地文件,方便后续的读取使用
private static void saveCookieStore(CookieStore cookieStore, String savePath) throws IOException {
......@@ -388,8 +388,8 @@ public class ZionApplicationTests {
os.writeObject(cookieStore);
os.close();
}*/
/*
}
//读取Cookie的序列化文件,读取后可以直接使用
private static CookieStore readCookieStore(String savePath) throws IOException, ClassNotFoundException {
......@@ -400,8 +400,8 @@ public class ZionApplicationTests {
return cookieStore;
}*/
/*
}
private List<NameValuePair> setHttpParams(Map<String, Object> paramsMap) {
List<NameValuePair> list = new ArrayList<NameValuePair>();
for (String key : paramsMap.keySet()) {
......@@ -409,8 +409,8 @@ public class ZionApplicationTests {
}
return list;
}
*/
/*
@Test
public void testDate() throws ParseException {
......@@ -421,8 +421,8 @@ public class ZionApplicationTests {
String s = String.valueOf(it);
System.out.println(s);
}*/
/*
}
@Test
public void testP(){
......@@ -430,7 +430,7 @@ public class ZionApplicationTests {
BigDecimal de=new BigDecimal("100");
decimal.divide(de,2,BigDecimal.ROUND_HALF_UP);
}*/
}
@Test
public void testAesut(){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论