|
@@ -4,6 +4,7 @@ import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -79,6 +80,14 @@ public class PostCollectionsSystemController extends BaseController
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody PostCollectionsSystem postCollectionsSystem)
|
|
|
{
|
|
|
+ if (!getUsername().equals("admin")){
|
|
|
+ return error("仅管理员拥有该权限");
|
|
|
+ }
|
|
|
+ //补充字段
|
|
|
+ postCollectionsSystem.setCreateBy(getUsername());
|
|
|
+ postCollectionsSystem.setCreateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
|
|
|
+ postCollectionsSystem.setUpdateBy(getUsername());
|
|
|
+ postCollectionsSystem.setUpdateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
|
|
|
return toAjax(postCollectionsSystemService.insertPostCollectionsSystem(postCollectionsSystem));
|
|
|
}
|
|
|
|
|
@@ -91,7 +100,11 @@ public class PostCollectionsSystemController extends BaseController
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody PostCollectionsSystem postCollectionsSystem)
|
|
|
{
|
|
|
+ //补充字段
|
|
|
+ postCollectionsSystem.setUpdateBy(getUsername());
|
|
|
+ postCollectionsSystem.setUpdateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
|
|
|
return toAjax(postCollectionsSystemService.updatePostCollectionsSystem(postCollectionsSystem));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|