Commit acafeafb authored by xiwei's avatar xiwei

修改部分代码

parent ee026c38
...@@ -114,6 +114,12 @@ ...@@ -114,6 +114,12 @@
<artifactId>log4j-api</artifactId> <artifactId>log4j-api</artifactId>
<version>${log4j.version}</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
...@@ -183,25 +189,25 @@ ...@@ -183,25 +189,25 @@
<!-- 结合(resources》resource》excludes的配置使用 --> <!-- 结合(resources》resource》excludes的配置使用 -->
<!-- 打包出的结构 http://doc.mingsoft.net/server/huan-jing-pei-zhi/jarbu-shu.html#%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84--> <!-- 打包出的结构 http://doc.mingsoft.net/server/huan-jing-pei-zhi/jarbu-shu.html#%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84-->
<!-- 打包war包时,注释掉此插件--> <!-- 打包war包时,注释掉此插件-->
<plugin> <!-- <plugin>-->
<artifactId>maven-assembly-plugin</artifactId> <!-- <artifactId>maven-assembly-plugin</artifactId>-->
<version>3.1.1</version> <!-- <version>3.1.1</version>-->
<executions> <!-- <executions>-->
<execution> <!-- <execution>-->
<id>build-package</id> <!-- <id>build-package</id>-->
<phase>package</phase> <!-- <phase>package</phase>-->
<goals> <!-- <goals>-->
<goal>single</goal> <!-- <goal>single</goal>-->
</goals> <!-- </goals>-->
<configuration> <!-- <configuration>-->
<finalName>${project.artifactId}</finalName> <!-- <finalName>${project.artifactId}</finalName>-->
<descriptors> <!-- <descriptors>-->
<descriptor>assembly.xml</descriptor> <!-- <descriptor>assembly.xml</descriptor>-->
</descriptors> <!-- </descriptors>-->
</configuration> <!-- </configuration>-->
</execution> <!-- </execution>-->
</executions> <!-- </executions>-->
</plugin> <!-- </plugin>-->
</plugins> </plugins>
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
...@@ -37,57 +37,58 @@ import org.springframework.web.bind.annotation.*; ...@@ -37,57 +37,58 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.List; import java.util.List;
/** /**
* 分类管理控制层 * 分类管理控制层
* @author 铭飞开发团队 * @author 铭飞开发团队
* 创建日期:2019-11-28 15:12:32<br/> * 创建日期:2019-11-28 15:12:32<br/>
* 历史修订:<br/> * 历史修订:<br/>
*/ */
@Api(tags={"前端-内容模块接口"}) @Api(tags = {"前端-内容模块接口"})
@Controller("WebcmsCategoryAction") @Controller("WebcmsCategoryAction")
@RequestMapping("/cms/category") @RequestMapping("/cms/category")
public class CategoryAction extends net.mingsoft.cms.action.BaseAction{ public class CategoryAction extends net.mingsoft.cms.action.BaseAction {
/** /**
* 注入分类业务层 * 注入分类业务层
*/ */
@Autowired @Autowired
private ICategoryBiz categoryBiz; private ICategoryBiz categoryBiz;
/** /**
* 查询分类列表 * 查询分类列表
* @param category 分类实体 * @param category 分类实体
*/ */
@ApiOperation(value = "查询分类列表接口") @ApiOperation(value = "查询分类列表接口")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required =false,paramType="query"), @ApiImplicitParam(name = CategoryEntity.Fields.categoryTitle, value = "栏目管理名称", required = false, paramType = "query"),
}) })
@PostMapping(value="/list") @PostMapping(value = "/list")
@ResponseBody @ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) { public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) {
BasicUtil.startPage(); BasicUtil.startPage();
category.setSqlWhere(""); category.setSqlWhere("");
List categoryList = categoryBiz.query(category); List categoryList = categoryBiz.query(category);
return ResultData.build().success(new EUListBean(categoryList,(int)BasicUtil.endPage(categoryList).getTotal())); return ResultData.build().success(new EUListBean(categoryList, (int) BasicUtil.endPage(categoryList).getTotal()));
} }
/** /**
* 获取分类 * 获取分类
* @param category 分类实体 * @param category 分类实体
*/ */
@ApiOperation(value = "获取分类列表接口") @ApiOperation(value = "获取分类列表接口")
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query") @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query")
@GetMapping("/get") @GetMapping("/get")
@ResponseBody @ResponseBody
public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category){ public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category) {
if(category.getId()==null) { if (category.getId() == null) {
return ResultData.build().error(); return ResultData.build().error();
} }
category.setSqlWhere(""); category.setSqlWhere("");
CategoryEntity _category = (CategoryEntity)categoryBiz.getById(category.getId()); CategoryEntity _category = (CategoryEntity) categoryBiz.getById(category.getId());
return ResultData.build().success(_category); return ResultData.build().success(_category);
} }
} }
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
package net.mingsoft.cms.entity; package net.mingsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import lombok.experimental.FieldNameConstants;
import net.mingsoft.base.entity.BaseEntity; import net.mingsoft.base.entity.BaseEntity;
import net.mingsoft.basic.util.BasicUtil; import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.config.MSProperties; import net.mingsoft.config.MSProperties;
...@@ -38,6 +39,7 @@ import java.io.File; ...@@ -38,6 +39,7 @@ import java.io.File;
* 历史修订:<br/> * 历史修订:<br/>
*/ */
@TableName("cms_category") @TableName("cms_category")
@FieldNameConstants
public class CategoryEntity extends BaseEntity { public class CategoryEntity extends BaseEntity {
private static final long serialVersionUID = 1574925152750L; private static final long serialVersionUID = 1574925152750L;
......
spring: spring:
datasource: datasource:
url: jdbc:mysql://localhost:3306/mcms?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=true url: jdbc:mysql://192.168.5.1:3306/cms?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=true
username: root username: root
password: root password: Orz2me
filters: wall,mergeStat filters: wall,mergeStat
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
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