修复文章时间戳等问题

This commit is contained in:
hupeng
2020-02-02 17:11:27 +08:00
parent fd182495fb
commit daedd43e43
6 changed files with 20 additions and 18 deletions

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>yshop-api</artifactId>
<name>API模块</name>
<name>移动端模块</name>
<properties>
<jjwt.version>0.10.6</jjwt.version>

View File

@ -22,13 +22,6 @@ spring:
redis:
repositories:
enabled: false
#配置rocketmq
rocketmq:
nameServer: localhost:9876
producer:
group: yshop-group
sendMessageTimeout: 300000
#配置 Jpa
jpa:
properties:
@ -36,6 +29,13 @@ rocketmq:
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
open-in-view: true
#配置rocketmq
rocketmq:
nameServer: localhost:9876
producer:
group: yshop-group
sendMessageTimeout: 300000
#七牛云

View File

@ -17,11 +17,13 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
/**
* @author hupeng
* @date 2019-10-07
*/
@Api(tags = "YxArticle管理")
@Api(tags = "图文管理")
@RestController
@RequestMapping("api")
public class YxArticleController {
@ -30,7 +32,7 @@ public class YxArticleController {
private YxArticleService yxArticleService;
@ApiOperation(value = "查询YxArticle")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxArticle")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_SELECT')")
public ResponseEntity getYxArticles(YxArticleQueryCriteria criteria, Pageable pageable){
@ -38,16 +40,16 @@ public class YxArticleController {
}
@ApiOperation(value = "新增YxArticle")
@ApiOperation(value = "新增")
@PostMapping(value = "/yxArticle")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxArticle resources){
resources.setAddTime(DateUtil.now());
resources.setAddTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm"));
return new ResponseEntity(yxArticleService.create(resources),HttpStatus.CREATED);
}
@ApiOperation(value = "修改YxArticle")
@ApiOperation(value = "修改")
@PutMapping(value = "/yxArticle")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxArticle resources){
@ -56,7 +58,7 @@ public class YxArticleController {
}
@ApiOperation(value = "删除YxArticle")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxArticle/{id}")
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){

View File

@ -81,7 +81,7 @@ public class YxArticleServiceImpl implements YxArticleService {
@Override
@Transactional(rollbackFor = Exception.class)
public YxArticleDTO create(YxArticle resources) {
resources.setAddTime(String.valueOf(OrderUtil.getSecondTimestampTwo()));
//resources.setAddTime(String.valueOf(OrderUtil.getSecondTimestampTwo()));
return yxArticleMapper.toDto(yxArticleRepository.save(resources));
}

View File

@ -81,7 +81,7 @@ swagger:
enabled: true
title: yshop商城管理后台API
serverUrl: http://localhost:8000
version: 1.8
version: 1.9
# 文件存储路径
file: