♻️ feat(新增): 修改部门实体类名称和注解
This commit is contained in:
parent
fd19147fd6
commit
349f02348a
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.entity.base
|
||||
package cn.bunny.dao.entity
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField
|
||||
import com.baomidou.mybatisplus.annotation.*
|
||||
|
@ -27,7 +27,7 @@ open class BaseEntity : Serializable {
|
|||
@Schema(name = "updateTime", title = "更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
var updateTime: LocalDateTime? = null
|
||||
|
||||
|
||||
@Schema(name = "createUser", title = "创建用户")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.entity.system.email
|
||||
|
||||
import cn.bunny.dao.entity.base.BaseEntity
|
||||
import cn.bunny.dao.entity.BaseEntity
|
||||
import com.baomidou.mybatisplus.annotation.TableName
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import lombok.Getter
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.entity.system.email
|
||||
|
||||
import cn.bunny.dao.entity.base.BaseEntity
|
||||
import cn.bunny.dao.entity.BaseEntity
|
||||
import com.baomidou.mybatisplus.annotation.TableName
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import lombok.Getter
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.entity.system.log
|
||||
|
||||
import cn.bunny.dao.entity.base.BaseEntity
|
||||
import cn.bunny.dao.entity.BaseEntity
|
||||
import com.baomidou.mybatisplus.annotation.TableName
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import lombok.Getter
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.dao.entity.system.user
|
||||
|
||||
import cn.bunny.dao.entity.base.BaseEntity
|
||||
import cn.bunny.dao.entity.BaseEntity
|
||||
import com.baomidou.mybatisplus.annotation.TableName
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import lombok.Getter
|
||||
|
@ -24,7 +24,7 @@ import lombok.experimental.Accessors
|
|||
open class AdminUser : BaseEntity() {
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
var username: String? = null;
|
||||
var username: String? = null
|
||||
|
||||
@Schema(name = "nickName", title = "昵称")
|
||||
var nickName: String? = null
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.bunny.dao.pojo.email
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import lombok.AllArgsConstructor
|
||||
import lombok.Builder
|
||||
import lombok.Data
|
||||
|
@ -13,22 +14,24 @@ import org.springframework.web.multipart.MultipartFile
|
|||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Schema(name = "EmailSend", title = "邮件发送表单", description = "邮件发送表单")
|
||||
class EmailSend {
|
||||
// 给谁发送
|
||||
|
||||
@Schema(name = "sendTo", title = "给谁发送")
|
||||
var sendTo: String? = null
|
||||
|
||||
// 发送主题
|
||||
@Schema(name = "subject", title = "发送主题")
|
||||
var subject: String? = null
|
||||
|
||||
// 是否为富文本
|
||||
@Schema(name = "isRichText", title = "是否为富文本")
|
||||
var isRichText: Boolean? = null
|
||||
|
||||
// 发送内容
|
||||
@Schema(name = "message", title = "发送内容")
|
||||
var message: String? = null
|
||||
|
||||
// 抄送人
|
||||
@Schema(name = "ccParam", title = "抄送人")
|
||||
var ccParam: String? = null
|
||||
|
||||
// 发送的文件
|
||||
@Schema(name = "file", title = "发送的文件")
|
||||
var file: Array<MultipartFile>? = null
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.bunny.dao.pojo.email
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import lombok.AllArgsConstructor
|
||||
import lombok.Builder
|
||||
import lombok.Data
|
||||
|
@ -12,9 +13,19 @@ import lombok.NoArgsConstructor
|
|||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Schema(name = "EmailSendInit", title = "邮件发送初始化", description = "邮件发送初始化")
|
||||
class EmailSendInit {
|
||||
|
||||
@Schema(name = "port", title = "端口")
|
||||
var port: Int? = null
|
||||
|
||||
@Schema(name = "host", title = "主机")
|
||||
var host: String? = null
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
var username: String? = null
|
||||
|
||||
@Schema(name = "password", title = "密码")
|
||||
var password: String? = null
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
package cn.bunny.services.controller
|
||||
|
||||
import cn.bunny.dao.entity.system.user.AdminUser
|
||||
import cn.bunny.dao.pojo.result.PageResult
|
||||
import cn.bunny.dao.pojo.result.Result
|
||||
import cn.hutool.captcha.CaptchaUtil
|
||||
import io.swagger.v3.oas.annotations.Operation
|
||||
import io.swagger.v3.oas.annotations.tags.Tag
|
||||
import org.springframework.http.HttpHeaders
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
@ -15,4 +23,31 @@ class IndexController {
|
|||
fun index(): String {
|
||||
return "欢迎访问 Bunny Java Template,欢迎去Gitee:https://gitee.com/BunnyBoss/java_single.git"
|
||||
}
|
||||
|
||||
@Operation(summary = "生成验证码", description = "生成验证码")
|
||||
@GetMapping("noAuth/checkCode")
|
||||
fun checkCode(): ResponseEntity<ByteArray> {
|
||||
val headers = HttpHeaders()
|
||||
headers.contentType = MediaType.IMAGE_JPEG
|
||||
// 生成验证码
|
||||
val captcha = CaptchaUtil.createCircleCaptcha(150, 48, 4, 2)
|
||||
val image = captcha.imageBytes
|
||||
return ResponseEntity(image, headers, HttpStatus.OK)
|
||||
}
|
||||
|
||||
@Operation(summary = "测试访问路径", description = "测试访问路径")
|
||||
@GetMapping("/test")
|
||||
fun getTest(): Result<PageResult<AdminUser>> {
|
||||
val adminUser = AdminUser()
|
||||
adminUser.email = "@test@gmail.com"
|
||||
adminUser.password = "password"
|
||||
|
||||
val pageResult = PageResult<AdminUser>()
|
||||
pageResult.pageNo = 1
|
||||
pageResult.pageSize = 666
|
||||
pageResult.total = 888
|
||||
pageResult.list = listOf(adminUser)
|
||||
|
||||
return Result.success(pageResult)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
package cn.bunny.services.controller
|
||||
|
||||
import cn.bunny.dao.entity.system.user.AdminUser
|
||||
import cn.bunny.dao.pojo.result.PageResult
|
||||
import cn.bunny.dao.pojo.result.Result
|
||||
import cn.bunny.services.service.LoginService
|
||||
import io.swagger.v3.oas.annotations.Operation
|
||||
import io.swagger.v3.oas.annotations.tags.Tag
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.http.HttpHeaders
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Tag(name = "web相关接口")
|
||||
@RestController
|
||||
@RequestMapping("/admin")
|
||||
class WebController {
|
||||
@Autowired
|
||||
private val loginService: LoginService? = null
|
||||
|
||||
@Operation(summary = "生成验证码", description = "生成验证码")
|
||||
@GetMapping("noAuth/checkCode")
|
||||
fun checkCode(): ResponseEntity<ByteArray> {
|
||||
val headers = HttpHeaders()
|
||||
headers.contentType = MediaType.IMAGE_JPEG
|
||||
|
||||
val image = loginService!!.checkCode()
|
||||
return ResponseEntity(image, headers, HttpStatus.OK)
|
||||
}
|
||||
|
||||
@Operation(summary = "测试访问路径", description = "测试访问路径")
|
||||
@GetMapping("/test")
|
||||
fun getTest(): Result<PageResult<AdminUser>> {
|
||||
val adminUser = AdminUser()
|
||||
adminUser.email = "@test@gmail.com"
|
||||
adminUser.password = "password"
|
||||
|
||||
val pageResult = PageResult<AdminUser>()
|
||||
pageResult.pageNo = 1
|
||||
pageResult.pageSize = 666
|
||||
pageResult.total = 888
|
||||
pageResult.list = listOf(adminUser)
|
||||
|
||||
return Result.success(pageResult)
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service
|
||||
|
||||
interface LoginService {
|
||||
interface UserService {
|
||||
/**
|
||||
* * 生成验证码
|
||||
*
|
|
@ -1,11 +1,11 @@
|
|||
package cn.bunny.services.service.impl
|
||||
|
||||
import cn.bunny.services.service.LoginService
|
||||
import cn.bunny.services.service.UserService
|
||||
import cn.hutool.captcha.CaptchaUtil
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class LoginServiceImpl : LoginService {
|
||||
class UserServiceImpl : UserService {
|
||||
/**
|
||||
* * 生成验证码
|
||||
*
|
Loading…
Reference in New Issue