5-10 代码提交
This commit is contained in:
@@ -2,6 +2,7 @@ package com.yxt.demo.system.api.sys_resources;
|
|||||||
|
|
||||||
import com.yxt.demo.system.utils.BaseEntity;
|
import com.yxt.demo.system.utils.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
@@ -19,4 +20,6 @@ public class SysResources extends BaseEntity {
|
|||||||
private String typeKey;
|
private String typeKey;
|
||||||
|
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
private MultipartFile file;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
package com.yxt.demo.system.api.sys_resources;
|
package com.yxt.demo.system.api.sys_resources;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:26
|
* @Date 2023/4/24 14:26
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
|
@Api(value = "")
|
||||||
public interface SysResourcesFeign {
|
public interface SysResourcesFeign {
|
||||||
|
|
||||||
|
@ApiOperation(value = "上传")
|
||||||
|
@RequestMapping("/upload")
|
||||||
|
ResultBean upload(MultipartFile file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectSysPlanCommentBySid" resultType="com.yxt.demo.system.api.sys_plan.SysPlan">
|
<select id="selectSysPlanCommentBySid" resultType="com.yxt.demo.system.api.sys_plan.SysPlan">
|
||||||
select p.id,p.sid,p.teacherNo,p.studentNo,p.planContent,p.planOpinion,ps.planContent planContentJd,ps.planOpinion planOpinionYj from sys_plan p
|
select p.id,p.sid,p.teacherNo,p.studentNo,p.planContent,ps.planContent planContentJd,ps.planOpinion from sys_plan p
|
||||||
left join sys_plan_schedule ps
|
left join sys_plan_schedule ps
|
||||||
on p.sid = ps.planSid
|
on p.sid = ps.planSid
|
||||||
where p.sid = #{sid}
|
where p.sid = #{sid}
|
||||||
|
|||||||
@@ -8,15 +8,12 @@
|
|||||||
state = #{state},
|
state = #{state},
|
||||||
</if>
|
</if>
|
||||||
<if test="stateChinese != null">
|
<if test="stateChinese != null">
|
||||||
state = #{stateChinese},
|
stateChinese = #{stateChinese},
|
||||||
</if>
|
|
||||||
<if test="planContent != null">
|
|
||||||
planContent = #{planContent},
|
|
||||||
</if>
|
</if>
|
||||||
<if test="planOpinion != null">
|
<if test="planOpinion != null">
|
||||||
planOpinion=#{planOpinion},
|
planOpinion=#{planOpinion},
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where planSid=#{planSid}
|
where planSid=#{sid}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
package com.yxt.demo.system.biz.sys_resources;
|
package com.yxt.demo.system.biz.sys_resources;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yxt.demo.system.api.sys_resources.SysResources;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:26
|
* @Date 2023/4/24 14:26
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public interface SysResourcesMapper {
|
@Mapper
|
||||||
|
public interface SysResourcesMapper extends BaseMapper<SysResources> {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,28 @@
|
|||||||
package com.yxt.demo.system.biz.sys_resources;
|
package com.yxt.demo.system.biz.sys_resources;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_resources.SysResourcesFeign;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:26
|
* @Date 2023/4/24 14:26
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public class SysResourcesRest {
|
@RestController
|
||||||
|
@Api(tags = "自主资源表")
|
||||||
|
@RequestMapping("v1/sysResources")
|
||||||
|
public class SysResourcesRest implements SysResourcesFeign {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysResourcesService sysResourcesService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean upload(MultipartFile file) {
|
||||||
|
return sysResourcesService.upload(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,39 @@
|
|||||||
package com.yxt.demo.system.biz.sys_resources;
|
package com.yxt.demo.system.biz.sys_resources;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_resources.SysResources;
|
||||||
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
* @Date 2023/4/24 14:26
|
* @Date 2023/4/24 14:26
|
||||||
* @Description
|
* @Description
|
||||||
*/
|
*/
|
||||||
public class SysResourcesService {
|
@Service
|
||||||
|
public class SysResourcesService extends MybatisBaseService<SysResourcesMapper, SysResources> {
|
||||||
|
|
||||||
|
@Value("${reggie.path}")
|
||||||
|
private String basePath;
|
||||||
|
|
||||||
|
public ResultBean upload(MultipartFile file) {
|
||||||
|
String filename = file.getOriginalFilename();
|
||||||
|
String substring = filename.substring(filename.lastIndexOf("."));
|
||||||
|
String fileName = UUID.randomUUID().toString() + substring;
|
||||||
|
File file1 = new File(basePath);
|
||||||
|
if (!file1.exists()){
|
||||||
|
file1.mkdirs();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
file.transferTo(new File(basePath+fileName));
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ spring:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
upload:
|
upload:
|
||||||
path: D:\\demo\\upload\\
|
path: D:\demo\upload\
|
||||||
url:
|
url:
|
||||||
prefix: http://127.0.0.1:8111/upload/
|
prefix: http://127.0.0.1:8111/upload/
|
||||||
login:
|
login:
|
||||||
path: D:\\images\\pic-click
|
path: D:\\images\\pic-click
|
||||||
|
|
||||||
|
reggie:
|
||||||
|
path: D:\demo\upload\
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user