Browse Source

wps 文件查询

master
zhizhi wu 5 years ago
parent
commit
dc47c92662
  1. 13
      tall/src/main/java/com/ccsens/tall/bean/dto/WpsDto.java
  2. 12
      tall/src/main/java/com/ccsens/tall/bean/po/WpsFile.java
  3. 48
      tall/src/main/java/com/ccsens/tall/bean/po/WpsFileExample.java
  4. 11
      tall/src/main/java/com/ccsens/tall/bean/vo/UserVo.java
  5. 162
      tall/src/main/java/com/ccsens/tall/bean/vo/WpsVo.java
  6. 8
      tall/src/main/java/com/ccsens/tall/persist/dao/SysUserDao.java
  7. 26
      tall/src/main/java/com/ccsens/tall/service/IWpsService.java
  8. 96
      tall/src/main/java/com/ccsens/tall/service/WpsService.java
  9. 47
      tall/src/main/java/com/ccsens/tall/web/WpsController.java
  10. 17
      tall/src/main/resources/mapper_dao/SysUserDao.xml
  11. 28
      tall/src/main/resources/mapper_raw/WpsFileMapper.xml
  12. 4
      util/src/main/java/com/ccsens/util/CodeEnum.java
  13. 2
      util/src/main/java/com/ccsens/util/WebConstant.java

13
tall/src/main/java/com/ccsens/tall/bean/dto/WpsDto.java

@ -27,4 +27,17 @@ public class WpsDto {
@JsonProperty("_w_appid")
private String appId;
}
@ApiModel("上传文件新版本请求")
@Data
public static class FileSave{
@NotNull
@ApiModelProperty("请求签名")
@JsonProperty("_w_signature")
private String signature;
@NotNull
@ApiModelProperty("应用id")
@JsonProperty("_w_appid")
private String appId;
}
}

12
tall/src/main/java/com/ccsens/tall/bean/po/WpsFile.java

@ -6,7 +6,7 @@ import java.util.Date;
public class WpsFile implements Serializable {
private Long id;
private Integer cruurentVersion;
private Integer currentVersion;
private String name;
@ -34,12 +34,12 @@ public class WpsFile implements Serializable {
this.id = id;
}
public Integer getCruurentVersion() {
return cruurentVersion;
public Integer getCurrentVersion() {
return currentVersion;
}
public void setCruurentVersion(Integer cruurentVersion) {
this.cruurentVersion = cruurentVersion;
public void setCurrentVersion(Integer currentVersion) {
this.currentVersion = currentVersion;
}
public String getName() {
@ -113,7 +113,7 @@ public class WpsFile implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", cruurentVersion=").append(cruurentVersion);
sb.append(", currentVersion=").append(currentVersion);
sb.append(", name=").append(name);
sb.append(", size=").append(size);
sb.append(", downloadUrl=").append(downloadUrl);

48
tall/src/main/java/com/ccsens/tall/bean/po/WpsFileExample.java

@ -165,63 +165,63 @@ public class WpsFileExample {
return (Criteria) this;
}
public Criteria andCruurentVersionIsNull() {
addCriterion("cruurent_version is null");
public Criteria andCurrentVersionIsNull() {
addCriterion("current_version is null");
return (Criteria) this;
}
public Criteria andCruurentVersionIsNotNull() {
addCriterion("cruurent_version is not null");
public Criteria andCurrentVersionIsNotNull() {
addCriterion("current_version is not null");
return (Criteria) this;
}
public Criteria andCruurentVersionEqualTo(Integer value) {
addCriterion("cruurent_version =", value, "cruurentVersion");
public Criteria andCurrentVersionEqualTo(Integer value) {
addCriterion("current_version =", value, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionNotEqualTo(Integer value) {
addCriterion("cruurent_version <>", value, "cruurentVersion");
public Criteria andCurrentVersionNotEqualTo(Integer value) {
addCriterion("current_version <>", value, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionGreaterThan(Integer value) {
addCriterion("cruurent_version >", value, "cruurentVersion");
public Criteria andCurrentVersionGreaterThan(Integer value) {
addCriterion("current_version >", value, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionGreaterThanOrEqualTo(Integer value) {
addCriterion("cruurent_version >=", value, "cruurentVersion");
public Criteria andCurrentVersionGreaterThanOrEqualTo(Integer value) {
addCriterion("current_version >=", value, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionLessThan(Integer value) {
addCriterion("cruurent_version <", value, "cruurentVersion");
public Criteria andCurrentVersionLessThan(Integer value) {
addCriterion("current_version <", value, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionLessThanOrEqualTo(Integer value) {
addCriterion("cruurent_version <=", value, "cruurentVersion");
public Criteria andCurrentVersionLessThanOrEqualTo(Integer value) {
addCriterion("current_version <=", value, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionIn(List<Integer> values) {
addCriterion("cruurent_version in", values, "cruurentVersion");
public Criteria andCurrentVersionIn(List<Integer> values) {
addCriterion("current_version in", values, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionNotIn(List<Integer> values) {
addCriterion("cruurent_version not in", values, "cruurentVersion");
public Criteria andCurrentVersionNotIn(List<Integer> values) {
addCriterion("current_version not in", values, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionBetween(Integer value1, Integer value2) {
addCriterion("cruurent_version between", value1, value2, "cruurentVersion");
public Criteria andCurrentVersionBetween(Integer value1, Integer value2) {
addCriterion("current_version between", value1, value2, "currentVersion");
return (Criteria) this;
}
public Criteria andCruurentVersionNotBetween(Integer value1, Integer value2) {
addCriterion("cruurent_version not between", value1, value2, "cruurentVersion");
public Criteria andCurrentVersionNotBetween(Integer value1, Integer value2) {
addCriterion("current_version not between", value1, value2, "currentVersion");
return (Criteria) this;
}

11
tall/src/main/java/com/ccsens/tall/bean/vo/UserVo.java

@ -90,4 +90,15 @@ public class UserVo {
@ApiModelProperty("用户id")
private Long userId;
}
@Data
@ApiModel("用户信息")
public static class UserInfo{
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("昵称")
private String nickname;
@ApiModelProperty("头像")
private String avatarUrl;
}
}

162
tall/src/main/java/com/ccsens/tall/bean/vo/WpsVo.java

@ -0,0 +1,162 @@
package com.ccsens.tall.bean.vo;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.annotation.JSONField;
import com.ccsens.tall.bean.po.WpsFile;
import com.ccsens.util.WebConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description: wps相关接口返回值
* @author: whj
* @time: 2020/6/18 10:21
*/
@ApiModel("wps相关接口返回值")
public class WpsVo {
@ApiModel("文件保存返回信息")
@Data
public static class FileSave {
@ApiModelProperty("文件基本信息")
private FileBase file;
}
@Data
@ApiModel("文件基本信息")
public static class FileBase {
@ApiModelProperty("文件id,字符串长度小于40")
private String id;
@ApiModelProperty("文件名")
private String name;
@ApiModelProperty("当前版本号,位数小于11")
private Integer version;
@ApiModelProperty("文件大小,单位为B")
private Integer size;
@ApiModelProperty("文档下载地址")
private String download_url;
}
@Data
@ApiModel("文件信息查询返回")
public static class FileInfo{
@ApiModelProperty("文件信息")
private File file;
@ApiModelProperty("用户信息")
private User user;
}
@ApiModel("文件信息")
@Data
public static class File{
@ApiModelProperty("文件id,字符串长度小于40")
private String id;
@ApiModelProperty("文件名")
private String name;
@ApiModelProperty("当前版本号,位数小于11")
private Integer version;
@ApiModelProperty("文件大小,单位为B")
private Integer size;
@ApiModelProperty("文档下载地址")
private String download_url;
@ApiModelProperty("创建者id,字符串长度小于40")
private String creator;
@ApiModelProperty("创建时间,时间戳,单位为秒")
private Long create_time;
@ApiModelProperty("修改者id,字符串长度小于40")
private String modifier;
@ApiModelProperty("修改时间,时间戳,单位为秒")
private Long modify_time;
@ApiModelProperty("用户权限")
private UserAcl user_acl = new UserAcl();
@ApiModelProperty("水印")
private Watermark watermark;
public File(String id, String name, Integer version, Integer size, String download_url, String creator, Long create_time, String modifier, Long modify_time) {
this.id = id;
this.name = name;
this.version = version;
this.size = size;
this.download_url = download_url;
this.creator = creator;
this.create_time = create_time;
this.modifier = modifier;
this.modify_time = modify_time;
}
public static File beanToVo(WpsFile wpsFile, String name) {
File file = new File(wpsFile.getId()+"", wpsFile.getName(),
wpsFile.getCurrentVersion(), wpsFile.getSize(),
wpsFile.getDownloadUrl(), wpsFile.getCreator() + "",
wpsFile.getCreatedAt().getTime()/1000,
wpsFile.getModifier() + "",
wpsFile.getUpdatedAt().getTime()/1000
);
Watermark watermark = new Watermark(StrUtil.isEmpty(name) ? WebConstant.DEFAULT_NICKNAME : name);
file.watermark = watermark;
return file;
}
}
@ApiModel("用户信息")
@Data
public static class User{
@ApiModelProperty("用户id")
private String id;
@ApiModelProperty("用户名称")
private String name;
@ApiModelProperty("用户操作权限,write:可编辑,read:预览")
private String permission = WebConstant.Wps.PERMISSION_READ;
@ApiModelProperty("用户头像地址")
private String avatar_url;
public static User getInstance(UserVo.UserInfo userInfo) {
User user = new User();
user.setId(String.valueOf(userInfo.getId()));
user.setName(userInfo.getNickname());
user.setAvatar_url(userInfo.getAvatarUrl());
return user;
}
}
@ApiModel("用户权限信息")
@Data
public static class UserAcl{
@ApiModelProperty("重命名权限,1为打开该权限,0为关闭该权限,默认为0")
private Byte rename = 1;
@ApiModelProperty("历史版本权限,1为打开该权限,0为关闭该权限,默认为1")
private Byte history = 1;
@ApiModelProperty("复制")
private Byte copy = 1;
@ApiModelProperty("导出PDF")
private Byte export = 1;
@ApiModelProperty("打印")
private Byte print = 1;
}
@ApiModel("水印信息")
@Data
public static class Watermark{
@ApiModelProperty("水印类型, 0为无水印; 1为文字水印")
private Byte type;
@ApiModelProperty("文字水印的文字,当type为1时此字段必选")
private String value;
@ApiModelProperty("水印的透明度,非必选,有默认值")
private String fillstyle;
@ApiModelProperty("水印的字体,非必选,有默认值")
private String font;
@ApiModelProperty("水印的旋转度,非必选,有默认值")
private String rotate;
@ApiModelProperty("水印水平间距,非必选,有默认值")
private String horizontal;
@ApiModelProperty("水印垂直间距,非必选,有默认值")
private String vertical;
public Watermark(String value) {
this.type = 1;
this.value = value;
}
}
}

8
tall/src/main/java/com/ccsens/tall/persist/dao/SysUserDao.java

@ -1,5 +1,6 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.bean.vo.UserVo;
import com.ccsens.tall.persist.mapper.SysUserMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -24,4 +25,11 @@ public interface SysUserDao extends SysUserMapper {
String getUserNameByUserId(@Param("userId") Long userId);
void replaceComment(@Param("oldUserId")Long userId, @Param("newUserId") Long currentUserId);
/**
* 查询用户信息
* @param userId
* @return
*/
UserVo.UserInfo getUserInfoByUserId(Long userId);
}

26
tall/src/main/java/com/ccsens/tall/service/IWpsService.java

@ -1,4 +1,30 @@
package com.ccsens.tall.service;
import com.ccsens.tall.bean.dto.WpsDto;
import com.ccsens.tall.bean.vo.WpsVo;
import javax.servlet.http.Part;
/**
* @author whj
*/
public interface IWpsService {
/**
* 获取文件元数据
* @param fileId
* @param token
* @return
* @throws Exception
*/
WpsVo.FileInfo getFileInfo(String fileId, String token) throws Exception;
/**
* 上传文件新版本
* @param token
* @param fileId
* @param fileSave
* @param file
* @return
*/
WpsVo.FileSave fileSave(String token, String fileId, WpsDto.FileSave fileSave, Part file);
}

96
tall/src/main/java/com/ccsens/tall/service/WpsService.java

@ -1,10 +1,29 @@
package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.tall.bean.dto.WpsDto;
import com.ccsens.tall.bean.po.ProProjectFile;
import com.ccsens.tall.bean.po.ProProjectFileExample;
import com.ccsens.tall.bean.po.WpsFile;
import com.ccsens.tall.bean.po.WpsFileExample;
import com.ccsens.tall.bean.vo.UserVo;
import com.ccsens.tall.bean.vo.WpsVo;
import com.ccsens.tall.persist.dao.SysUserDao;
import com.ccsens.tall.persist.mapper.ProProjectFileMapper;
import com.ccsens.tall.persist.mapper.WpsFileMapper;
import com.ccsens.util.*;
import com.ccsens.util.exception.BaseException;
import io.jsonwebtoken.Claims;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.Part;
import java.util.List;
/**
* @description:
* @author: whj
@ -13,5 +32,80 @@ import org.springframework.transaction.annotation.Transactional;
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class WpsService {
public class WpsService implements IWpsService {
@Resource
private WpsFileMapper wpsFileMapper;
@Resource
private SysUserDao sysUserDao;
@Resource
private ProProjectFileMapper proProjectFileMapper;
@Resource
private IProRoleService proRoleService;
@Resource
private RedisUtil redisUtil;
@Override
public WpsVo.FileInfo getFileInfo(String fileId, String token) throws Exception {
Long userId = getUserId(token);
// 查询文件信息
WpsFile wpsFile = wpsFileMapper.selectByPrimaryKey(Long.parseLong(fileId));
log.info("文件信息:{}", wpsFile);
if (wpsFile == null) {
throw new BaseException(CodeEnum.FILE_NOT_FOUND);
}
// 查询用户信息
UserVo.UserInfo userInfo = sysUserDao.getUserInfoByUserId(userId);
log.info("用户信息:{}", userInfo);
if (userInfo == null) {
throw new BaseException(CodeEnum.NOT_LOGIN);
}
WpsVo.User user = WpsVo.User.getInstance(userInfo);
//封装对象
WpsVo.FileInfo fileInfo = new WpsVo.FileInfo();
WpsVo.File file = WpsVo.File.beanToVo(wpsFile,userInfo.getNickname());
fileInfo.setFile(file);
fileInfo.setUser(user);
// 查询权限信息
ProProjectFileExample projectFileExample = new ProProjectFileExample();
projectFileExample.createCriteria().andFileIdEqualTo(wpsFile.getId());
List<ProProjectFile> proProjectFiles = proProjectFileMapper.selectByExample(projectFileExample);
log.info("文件项目关系:{}", proProjectFiles);
if (CollectionUtil.isEmpty(proProjectFiles)) {
return fileInfo;
}
int power = proRoleService.selectPowerByRoleName(userId, proProjectFiles.get(0).getId());
log.info("权限:{}", power);
if (power > 1) {
user.setPermission(WebConstant.Wps.PERMISSION_WRITE);
}
return fileInfo;
}
@Override
public WpsVo.FileSave fileSave(String token, String fileId, WpsDto.FileSave fileSave, Part file) {
// 保存文件
// 判断有无项目ID
// 保存文件版本信息
// 更新文件记录
return null;
}
private Long getUserId(String token) throws Exception {
Claims claims = JwtUtil.parseJWT(token, WebConstant.JWT_ACCESS_TOKEN_SECERT);
long userId = Long.parseLong(claims.getSubject());
String redisToken = (String)redisUtil.get(RedisKeyManager.getTokenCachedKey(userId));
if (StrUtil.isEmpty(redisToken)) {
throw new BaseException(CodeEnum.NOT_LOGIN);
}
return userId;
}
}

47
tall/src/main/java/com/ccsens/tall/web/WpsController.java

@ -1,9 +1,12 @@
package com.ccsens.tall.web;
import com.ccsens.tall.bean.dto.WpsDto;
import com.ccsens.tall.bean.vo.WpsVo;
import com.ccsens.tall.service.IWpsService;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.WebConstant;
import com.ccsens.util.WpsSignature;
import com.ccsens.util.exception.BaseException;
import io.swagger.annotations.*;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@ -12,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Part;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.Map;
@ -34,22 +38,18 @@ public class WpsController {
@ApiImplicitParams({
})
@GetMapping(value = "file/info", produces = {"application/json;charset=UTF-8"})
public String fileInfo(HttpServletRequest request, @Valid WpsDto.FileInfo fileInfo){
public WpsVo.FileInfo fileInfo(HttpServletRequest request, @Valid WpsDto.FileInfo fileInfo) throws Exception {
log.info("获取文件元数据请求参数:{}", fileInfo);
WpsHeader header = WpsHeader.getHeader(request);
Map<String, String> paramMap = initMap();
String signature = WpsSignature.getSignature(paramMap, WebConstant.Wps.APPKEY);
if (!signature.equals(fileInfo.getSignature())) {
// TODO 验签失败
}
WpsHeader header = checkSignature(request, fileInfo.getSignature());
// 判断登录,查询userid
WpsVo.FileInfo fileInfoVo = wpsService.getFileInfo(header.getFileId(), header.getToken());
return null;
return fileInfoVo;
}
@ApiOperation(value = "获取用户信息", notes = "在编辑的时候获取编辑过此文件的用户信息,展示在协作记录里面")
@ApiImplicitParams({
})
@ -64,10 +64,17 @@ public class WpsController {
@ApiImplicitParams({
})
@PostMapping(value = "file/save", produces = {"application/json;charset=UTF-8"})
public String fileSave(){
return null;
public WpsVo.FileSave fileSave(HttpServletRequest request, @Valid WpsDto.FileSave fileSave, @RequestBody Part file){
log.info("上传文件新版本请求参数:{}", fileSave);
WpsHeader header = checkSignature(request, fileSave.getSignature());
WpsVo.FileSave save = wpsService.fileSave(header.getToken(), header.getFileId(), fileSave, file);
return save;
}
@ApiOperation(value = "通知文件有那些人在协作协作", notes = "通知此文件目前有那些人正在协作")
@ApiImplicitParams({
})
@ -148,4 +155,20 @@ public class WpsController {
paramMap.put("_w_appid", WebConstant.Wps.APPID);
return paramMap;
}
/**
* 签名验证
* @param request
* @param signature
*/
private WpsHeader checkSignature(HttpServletRequest request, String signature) {
WpsHeader header = WpsHeader.getHeader(request);
Map<String, String> paramMap = initMap();
String newSignature = WpsSignature.getSignature(paramMap, WebConstant.Wps.APPKEY);
if (!signature.equals(newSignature)) {
log.info("签名验证失败");
throw new BaseException(CodeEnum.SIGNATURE_FAIL);
}
return header;
}
}

17
tall/src/main/resources/mapper_dao/SysUserDao.xml

@ -91,4 +91,21 @@
u.id = #{userId}
limit 1
</select>
<select id="getUserInfoByUserId" resultType="com.ccsens.tall.bean.vo.UserVo$UserInfo">
SELECT
u.id,
IF( u.nickname = '', a.identifier, u.nickname ) AS nickname,
u.avatar_url as avatarUrl
FROM
t_sys_user u
LEFT JOIN t_sys_auth a ON u.id = a.user_id
AND a.identify_type = 3
WHERE
u.rec_status = 0
and
a.rec_status = 0
and
u.id = #{userId}
limit 1
</select>
</mapper>

28
tall/src/main/resources/mapper_raw/WpsFileMapper.xml

@ -3,7 +3,7 @@
<mapper namespace="com.ccsens.tall.persist.mapper.WpsFileMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.WpsFile">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="cruurent_version" jdbcType="INTEGER" property="cruurentVersion" />
<result column="current_version" jdbcType="INTEGER" property="currentVersion" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="size" jdbcType="INTEGER" property="size" />
<result column="download_url" jdbcType="VARCHAR" property="downloadUrl" />
@ -72,7 +72,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, cruurent_version, name, size, download_url, creator, modifier, created_at, updated_at,
id, current_version, name, size, download_url, creator, modifier, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.WpsFileExample" resultMap="BaseResultMap">
@ -106,11 +106,11 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.WpsFile">
insert into t_wps_file (id, cruurent_version, name,
insert into t_wps_file (id, current_version, name,
size, download_url, creator,
modifier, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{cruurentVersion,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
values (#{id,jdbcType=BIGINT}, #{currentVersion,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{size,jdbcType=INTEGER}, #{downloadUrl,jdbcType=VARCHAR}, #{creator,jdbcType=BIGINT},
#{modifier,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
@ -121,8 +121,8 @@
<if test="id != null">
id,
</if>
<if test="cruurentVersion != null">
cruurent_version,
<if test="currentVersion != null">
current_version,
</if>
<if test="name != null">
name,
@ -153,8 +153,8 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="cruurentVersion != null">
#{cruurentVersion,jdbcType=INTEGER},
<if test="currentVersion != null">
#{currentVersion,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
@ -194,8 +194,8 @@
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.cruurentVersion != null">
cruurent_version = #{record.cruurentVersion,jdbcType=INTEGER},
<if test="record.currentVersion != null">
current_version = #{record.currentVersion,jdbcType=INTEGER},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
@ -229,7 +229,7 @@
<update id="updateByExample" parameterType="map">
update t_wps_file
set id = #{record.id,jdbcType=BIGINT},
cruurent_version = #{record.cruurentVersion,jdbcType=INTEGER},
current_version = #{record.currentVersion,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
size = #{record.size,jdbcType=INTEGER},
download_url = #{record.downloadUrl,jdbcType=VARCHAR},
@ -245,8 +245,8 @@
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.WpsFile">
update t_wps_file
<set>
<if test="cruurentVersion != null">
cruurent_version = #{cruurentVersion,jdbcType=INTEGER},
<if test="currentVersion != null">
current_version = #{currentVersion,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
@ -277,7 +277,7 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.WpsFile">
update t_wps_file
set cruurent_version = #{cruurentVersion,jdbcType=INTEGER},
set current_version = #{currentVersion,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
size = #{size,jdbcType=INTEGER},
download_url = #{downloadUrl,jdbcType=VARCHAR},

4
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -116,7 +116,9 @@ public enum CodeEnum {
NOT_COMMENT(98,"该评论不存在",true),
NOT_MESSAGE_TYPE(99,"找不到消息类型,请检查名称是否正确",true),
NOT_LABEL(100,"标签不存在,请检查后操作",true),
REPEAT_LABEL(100,"标签已存在,请勿重复添加",true),
REPEAT_LABEL(101,"标签已存在,请勿重复添加",true),
FILE_NOT_FOUND(102,"未找到对应的文件,请检查后操作",true),
SIGNATURE_FAIL(103,"签名验证失败",true),
;
public CodeEnum addMsg(String msg){

2
util/src/main/java/com/ccsens/util/WebConstant.java

@ -35,6 +35,8 @@ public class WebConstant {
public static final class Wps{
public static final String APPID = "09d77d2eb919438e8ae4f2a9ec6ec8dd";
public static final String APPKEY = "1b52d9ef8b1c4019be49f211b84c4f90";
public static final String PERMISSION_READ = "read";
public static final String PERMISSION_WRITE = "write";
}
public static final class Message{

Loading…
Cancel
Save