-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
222481d
commit 492fab4
Showing
17 changed files
with
282 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/com/swpu/uchain/blog/controller/TypesController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.swpu.uchain.blog.controller; | ||
|
||
import com.swpu.uchain.blog.form.InsertTypesForm; | ||
import com.swpu.uchain.blog.form.UpdateTypesForm; | ||
import com.swpu.uchain.blog.service.TypesService; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import io.swagger.annotations.Tag; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
/** | ||
* @author hobo | ||
* @description | ||
*/ | ||
@RestController | ||
@RequestMapping("/types") | ||
@Api(tags = "文章分类接口") | ||
@CrossOrigin | ||
public class TypesController { | ||
|
||
@Autowired | ||
private TypesService typesService; | ||
|
||
@ApiOperation("添加分类") | ||
@PostMapping(name = "添加分类",value = "/insert") | ||
public Object insertType(InsertTypesForm form) { | ||
return typesService.insertTypes(form); | ||
} | ||
|
||
@ApiOperation("更新分类") | ||
@PostMapping(name = "更新分类",value = "/update") | ||
public Object updateType(UpdateTypesForm form) { | ||
return typesService.updateTypes(form); | ||
} | ||
|
||
@ApiOperation("删除分类") | ||
@GetMapping(name = "删除分类",value = "/delete") | ||
public Object deleteType(Integer id) { | ||
return typesService.deleteTypes(id); | ||
} | ||
|
||
@ApiOperation("查询所有分类") | ||
@GetMapping(name = "查询所有分类",value = "/all") | ||
public Object selectAllType(){ | ||
return typesService.selectAllTypes(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,6 @@ | |
public class ArticleDTO { | ||
|
||
private Long id; | ||
/** | ||
* 概要 | ||
*/ | ||
private String digest; | ||
|
||
/** | ||
* 作者 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/com/swpu/uchain/blog/form/InsertTypesForm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.swpu.uchain.blog.form; | ||
|
||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
|
||
/** | ||
* @author hobo | ||
* @description | ||
*/ | ||
@Data | ||
public class InsertTypesForm { | ||
|
||
@ApiModelProperty("分类") | ||
private String typeMsg; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/swpu/uchain/blog/form/SelectByTagForm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.swpu.uchain.blog.form; | ||
|
||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
|
||
/** | ||
* @author hobo | ||
* @description | ||
*/ | ||
@Data | ||
public class SelectByTagForm { | ||
|
||
@ApiModelProperty("页数") | ||
private int pageNum; | ||
|
||
@ApiModelProperty("一页展示的个数") | ||
private int pageSize; | ||
|
||
@ApiModelProperty("标签id") | ||
private Integer tagId; | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/swpu/uchain/blog/form/SelectByTypeForm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.swpu.uchain.blog.form; | ||
|
||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
|
||
/** | ||
* @author hobo | ||
* @description | ||
*/ | ||
@Data | ||
public class SelectByTypeForm { | ||
|
||
@ApiModelProperty("页数") | ||
private int pageNum; | ||
|
||
@ApiModelProperty("一页展示的个数") | ||
private int pageSize; | ||
|
||
@ApiModelProperty("标签id") | ||
private Integer typeId; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/com/swpu/uchain/blog/form/UpdateTypesForm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.swpu.uchain.blog.form; | ||
|
||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
|
||
/** | ||
* @author hobo | ||
* @description | ||
*/ | ||
@Data | ||
public class UpdateTypesForm { | ||
|
||
@ApiModelProperty("分类id") | ||
private Integer id; | ||
|
||
@ApiModelProperty("分类") | ||
private String typeMsg; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.