diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 9639bc9c3..01606a4d8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -1,5 +1,6 @@ package com.ruoyi; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -9,6 +10,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; * * @author ruoyi */ +@MapperScan("com.ruoyi.system.mapper_yada") @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) public class RuoYiApplication { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ThematicMapController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ThematicMapController.java new file mode 100644 index 000000000..3b01a3023 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ThematicMapController.java @@ -0,0 +1,70 @@ +package com.ruoyi.web.controller.yada; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain_yada.ThematicMapDomain; +import com.ruoyi.system.service_yada.ThematicMapService; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 中国城市监测 + * @Author: JinSheng Song + * @Date: 2022/5/11 10:55 + */ +@RestController +@RequestMapping(value = "/thematic-map") +public class ThematicMapController { + + @Resource + private ThematicMapService thematicMapService; + + /** + * 查询方法 + * @param response + * @param request + * @return + */ + @RequestMapping(value = "/get/all",method = {RequestMethod.GET}) + public AjaxResult selectAllThematicMap(HttpServletResponse response, HttpServletRequest request) + { + List res= thematicMapService.selectAll(); + return AjaxResult.success(res); + } + + /** + * 删除方法 + * @param id + * @return + */ + @RequestMapping(value = "/delete",method = {RequestMethod.DELETE}) + public AjaxResult deleteThematicMap(@Param("id") Long id) + { + int num = thematicMapService.deleteById(id); + if (num>0) { + return AjaxResult.success(); + } + return AjaxResult.error(); + } + + /** + * 新增方法 + * @param thematicMapDomain + * @return + */ + @RequestMapping(value = "/add",method = {RequestMethod.POST}) + public AjaxResult saveThematicMap(ThematicMapDomain thematicMapDomain) + { + int num = thematicMapService.save(thematicMapDomain); + if (num>0) { + return AjaxResult.success(); + } + return AjaxResult.error(); + } +} diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index eda7f36e9..a65a211fe 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -18,7 +18,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8080 + port: 9900 servlet: # 应用的访问路径 context-path: / @@ -97,9 +97,9 @@ token: # MyBatis配置 mybatis: # 搜索指定包别名 - typeAliasesPackage: com.ruoyi.**.domain + typeAliasesPackage: com.ruoyi.**.domain,com.ruoyi.**.domain_yada # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml + mapperLocations: classpath*:mapper/**/*Mapper.xml,classpath*:mapper_yada/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml @@ -116,6 +116,7 @@ swagger: # 请求前缀 pathMapping: /dev-api + # 防止XSS攻击 xss: # 过滤开关 diff --git a/ruoyi-admin/src/main/resources/banner.txt b/ruoyi-admin/src/main/resources/banner.txt index a02645ec3..8e65fd3ab 100644 --- a/ruoyi-admin/src/main/resources/banner.txt +++ b/ruoyi-admin/src/main/resources/banner.txt @@ -1,24 +1,34 @@ Application Version: ${ruoyi.version} Spring Boot Version: ${spring-boot.version} //////////////////////////////////////////////////////////////////// -// _ooOoo_ // -// o6666666o // -// 88" . "88 // -// (| ^_^ |) // -// O\ = /O // -// ____/`---'\____ // -// .' \\| |// `. // -// / \\||| : |||// \ // -// / _||||| -:- |||||- \ // -// | | \\\ - /// | | // -// | \_| ''\---/'' | | // -// \ .-\__ `-` ___/-. / // -// ___`. .' /--.--\ `. . ___ // -// ."" '< `.___\_<|>_/___.' >'"". // -// | | : `- \`.;`\ _ /`;.`/ - ` : | | // -// \ \ `-. \_ __\ /__ _/ .-` / / // -// ========`-.____`-.___\_____/___.-`____.-'======== // -// `=---=' // + /\ + | | + | | + .' '. + | | + | | + | /\ | + .' |__|'. + | | | | + .' | | '. + /\ | \__/ | /\ + | | | | | | | | + /| | |,-\ | | /-,| | |\ + || |,-' | | | | '-,| || + ||-' | | | | '-|| +|\ _,-' | | | | '-,_ /| +|| ,-' _ | | | | '-, || +||-' =(*)= | | | | '-|| +|| | \ / | || +|\________....--------\ || /--------....________/| + /| || |\ + / | || | \ + / | \/ | \ + / | | \ + // .| |. \\ + .' |_./ | | \._| '. + / _.-||| |||-._ \ + \__.-' \||/\||/ '-.__/ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // -// 佛祖保佑 永不宕机 永无BUG // +// 飞机保佑 永不宕机 永无BUG // //////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/SysBaseEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/SysBaseEntity.java index bdef7faee..527685c9c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/SysBaseEntity.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/SysBaseEntity.java @@ -15,67 +15,61 @@ public class SysBaseEntity implements Serializable private static final long serialVersionUID = 1L; /** 创建者 */ - private String createBy; + private String createdBy; /** 创建时间 */ - private LocalDateTime createTime; + private LocalDateTime createdTime; /** 更新者 */ - private String updateBy; + private String updatedBy; /** 更新时间 */ - private LocalDateTime updateTime; + private LocalDateTime updatedTime; /** 备注 */ - private String remark; + private String remarks; /** 请求参数 */ private Map params; - public String getCreateBy() - { - return createBy; + public String getCreatedBy() { + return createdBy; } - public void setCreateBy(String createBy) - { - this.createBy = createBy; + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; } - public LocalDateTime getCreateTime() { - return createTime; + public LocalDateTime getCreatedTime() { + return createdTime; } - public void setCreateTime(LocalDateTime createTime) { - this.createTime = createTime; + public void setCreatedTime(LocalDateTime createdTime) { + this.createdTime = createdTime; } - public String getUpdateBy() - { - return updateBy; + public String getUpdatedBy() { + return updatedBy; } - public void setUpdateBy(String updateBy) - { - this.updateBy = updateBy; + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; } - public LocalDateTime getUpdateTime() { - return updateTime; + public LocalDateTime getUpdatedTime() { + return updatedTime; } - public void setUpdateTime(LocalDateTime updateTime) { - this.updateTime = updateTime; + public void setUpdatedTime(LocalDateTime updatedTime) { + this.updatedTime = updatedTime; } - public String getRemark() - { - return remark; + public String getRemarks() { + return remarks; } - public void setRemark(String remark) - { - this.remark = remark; + public void setRemarks(String remarks) { + this.remarks = remarks; } public Map getParams() diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/ThematicMapDomain.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/ThematicMapDomain.java new file mode 100644 index 000000000..49908b895 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/ThematicMapDomain.java @@ -0,0 +1,133 @@ +package com.ruoyi.system.domain_yada; + +import java.time.LocalDateTime; + +/** + * 专题图实体类 + * @Author: taco chen + * @Date: 2022/5/20 14:09 + */ +public class ThematicMapDomain extends SysBaseEntity { + + private Long id; + + private String pictureZh; + + private String pictureEn; + + private String pictureName; + + private String pictureType; + + private LocalDateTime pictureTime; + + private String picturePath; + + private String remarks; + + private String createdBy; + + private LocalDateTime createdTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPictureZh() { + return pictureZh; + } + + public void setPictureZh(String pictureZh) { + this.pictureZh = pictureZh; + } + + public String getPictureEn() { + return pictureEn; + } + + public void setPictureEn(String pictureEn) { + this.pictureEn = pictureEn; + } + + public String getPictureName() { + return pictureName; + } + + public void setPictureName(String pictureName) { + this.pictureName = pictureName; + } + + public String getPictureType() { + return pictureType; + } + + public void setPictureType(String pictureType) { + this.pictureType = pictureType; + } + + public LocalDateTime getPictureTime() { + return pictureTime; + } + + public void setPictureTime(LocalDateTime pictureTime) { + this.pictureTime = pictureTime; + } + + public String getPicturePath() { + return picturePath; + } + + public void setPicturePath(String picturePath) { + this.picturePath = picturePath; + } + + @Override + public String getRemarks() { + return remarks; + } + + @Override + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + @Override + public String getCreatedBy() { + return createdBy; + } + + @Override + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + @Override + public LocalDateTime getCreatedTime() { + return createdTime; + } + + @Override + public void setCreatedTime(LocalDateTime createdTime) { + this.createdTime = createdTime; + } + + @Override + public String toString() { + return "ThematicMapDomain{" + + "id=" + id + + ", pictureZh='" + pictureZh + '\'' + + ", pictureEn='" + pictureEn + '\'' + + ", pictureName='" + pictureName + '\'' + + ", pictureType='" + pictureType + '\'' + + ", pictureTime=" + pictureTime + + ", picturePath='" + picturePath + '\'' + + ", remarks='" + remarks + '\'' + + ", createdBy='" + createdBy + '\'' + + ", createdTime=" + createdTime + + '}'; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ThematicMapMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ThematicMapMapper.java new file mode 100644 index 000000000..3b03a98ab --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ThematicMapMapper.java @@ -0,0 +1,34 @@ +package com.ruoyi.system.mapper_yada; + +import com.ruoyi.system.domain_yada.ThematicMapDomain; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author taco chen + */ +public interface ThematicMapMapper { + + /** + * 获取所有专题图 + * @return + */ + List selectAllThematicMap(); + + /** + * 删除专题图根据编号 + * @param id 编号 + * @return + */ + Integer deleteThematicMap(Long id); + + /** + * 保存专题图 + * @param thematicMapDomain + * @return + */ + Integer saveThematicMap(ThematicMapDomain thematicMapDomain); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ThematicMapService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ThematicMapService.java new file mode 100644 index 000000000..2c46ef4b6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ThematicMapService.java @@ -0,0 +1,36 @@ +package com.ruoyi.system.service_yada; + +import com.ruoyi.system.domain_yada.ThematicMapDomain; + +import java.util.List; + +/** + * 专题图服务 + * @Author: taco chen + * @Date: 2022/5/11 11:40 + */ +public interface ThematicMapService { + + + /** + * 获取全部专题图 + * @return + */ + List selectAll(); + + /** + * 删除专题图根据编号 + * @param id 编号 + * @return + */ + Integer deleteById(Long id); + + /** + * 保存专题图 + * @param thematicMapDomain + * @return + */ + Integer save(ThematicMapDomain thematicMapDomain); + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ThematicMapServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ThematicMapServiceImpl.java new file mode 100644 index 000000000..3231ee023 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ThematicMapServiceImpl.java @@ -0,0 +1,49 @@ +package com.ruoyi.system.service_yada.impl; + +import com.ruoyi.system.domain_yada.ThematicMapDomain; +import com.ruoyi.system.mapper_yada.ThematicMapMapper; +import com.ruoyi.system.service_yada.ThematicMapService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * * 专题图服务 + * @author : taco chen + */ +@Service +public class ThematicMapServiceImpl implements ThematicMapService { + + @Resource + private ThematicMapMapper thematicMapMapper; + + /** + * 获取全部专题图 + * @return + */ + @Override + public List selectAll(){ + return thematicMapMapper.selectAllThematicMap(); + } + + /** + * 删除专题图根据编号 + * @param id 编号 + * @return + */ + @Override + public Integer deleteById(Long id){ + return thematicMapMapper.deleteThematicMap(id); + } + + /** + * 保存专题图 + * @param thematicMapDomain + * @return + */ + @Override + public Integer save(ThematicMapDomain thematicMapDomain){ + return thematicMapMapper.saveThematicMap(thematicMapDomain); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/ThematicMapMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ThematicMapMapper.xml new file mode 100644 index 000000000..8bc6ab2a5 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ThematicMapMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM thematic_map + WHERE ID=#{id} + + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index 18b2a3ed4..6f3363e21 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 若依管理系统 ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = 'http://192.168.2.105:9900' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true