Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
relation
Commits
3e90096d
Commit
3e90096d
authored
Aug 05, 2025
by
wujipeng
Browse files
标签接口
parent
b501cdb6
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/platform/controller/TagController.java
0 → 100644
View file @
3e90096d
package
com.platform.controller
;
import
com.platform.model.dto.TagDTO
;
import
com.platform.model.resp.Result
;
import
com.platform.service.TagService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
/**
* @author wujipeng
* @version 1.0
* @create 2025-08-05 20:16
*/
@RestController
@RequestMapping
(
"/tag"
)
public
class
TagController
extends
BaseController
{
@Resource
private
TagService
tagService
;
@ApiOperation
(
"标签列表"
)
@GetMapping
(
"/list"
)
public
Result
list
()
{
return
Result
.
data
(
tagService
.
list
());
}
@ApiOperation
(
"标签详情"
)
@GetMapping
(
"/{id}"
)
public
Result
detail
(
@PathVariable
String
id
)
{
return
Result
.
data
(
tagService
.
getById
(
id
));
}
@ApiOperation
(
"新增编辑"
)
@PostMapping
(
"/saveOrUpdate"
)
public
Result
add
(
@RequestBody
TagDTO
tagDTO
)
{
return
Result
.
data
(
tagService
.
saveOrUpdate
(
tagDTO
));
}
@ApiOperation
(
"删除"
)
@DeleteMapping
(
"/{id}"
)
public
Result
delete
(
@PathVariable
String
id
)
{
return
Result
.
data
(
tagService
.
removeById
(
id
));
}
}
src/main/java/com/platform/mapper/TagMapper.java
0 → 100644
View file @
3e90096d
package
com.platform.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.platform.model.entity.TagEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author wujipeng
* @version 1.0
* @create 2025-08-05 20:15
*/
@Mapper
public
interface
TagMapper
extends
BaseMapper
<
TagEntity
>
{
}
src/main/java/com/platform/model/dto/TagDTO.java
0 → 100644
View file @
3e90096d
package
com.platform.model.dto
;
import
com.platform.model.entity.TagEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* @author wujipeng
* @version 1.0
* @create 2025-08-05 20:20
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
TagDTO
extends
TagEntity
{
}
src/main/java/com/platform/model/entity/TagEntity.java
0 → 100644
View file @
3e90096d
package
com.platform.model.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
/**
* @author wujipeng
* @version 1.0
* @create 2025-08-05 20:05
*/
@Data
@TableName
(
"tag"
)
public
class
TagEntity
{
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
private
String
name
;
}
src/main/java/com/platform/service/TagService.java
0 → 100644
View file @
3e90096d
package
com.platform.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.platform.model.entity.TagEntity
;
/**
* @author wujipeng
* @version 1.0
* @create 2025-08-05 20:16
*/
public
interface
TagService
extends
IService
<
TagEntity
>
{
}
src/main/java/com/platform/service/impl/TagServiceImpl.java
0 → 100644
View file @
3e90096d
package
com.platform.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.platform.mapper.TagMapper
;
import
com.platform.model.entity.TagEntity
;
import
com.platform.service.TagService
;
import
org.springframework.stereotype.Service
;
/**
* @author wujipeng
* @version 1.0
* @create 2025-08-05 20:16
*/
@Service
public
class
TagServiceImpl
extends
ServiceImpl
<
TagMapper
,
TagEntity
>
implements
TagService
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment