forked from ITStudio_OUC/itstudio_manager
Merge pull request 'feat: All api url' (#1) from backend-dev into main
Reviewed-on: ITStudio_OUC/itstudio_manager#1
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
- /project-groups
|
||||
- /proof-images
|
||||
- /usages
|
||||
- /users
|
||||
|
||||
## 预计完成的 API 列表
|
||||
|
||||
@@ -43,10 +44,10 @@
|
||||
| `usages/{id}/upload_images/` | POST | 上传使用记录图片 |
|
||||
| `usages/current/` | GET | 获取当前使用中的记录 |
|
||||
| `usages/by_user/` | GET | 根据用户姓名获取使用记录 |
|
||||
| `item_categories/` | GET/POST/PUT/DELETE | 物品类别 CRUD 操作 |
|
||||
| `items/categories/`(原 `item_categories/`) | GET/POST/PUT/DELETE | 物品类别 CRUD 操作 |
|
||||
| `users/` | GET | 获取用户列表(只读) |
|
||||
| `item-images/` | GET/POST/PUT/DELETE | 物品图片 CRUD 操作 |
|
||||
| `usage-images/` | GET/POST/PUT/DELETE | 使用记录图片 CRUD 操作 |
|
||||
| `items/images/`(原 `item-images/`) | GET/POST/PUT/DELETE | 物品图片 CRUD 操作 |
|
||||
| `usages/images/`(原 `usage-images/`) | GET/POST/PUT/DELETE | 使用记录图片 CRUD 操作 |
|
||||
|
||||
---
|
||||
|
||||
@@ -77,7 +78,7 @@
|
||||
| `finance/{id}/` | DELETE | 删除财务记录(发送邮件通知) |
|
||||
| `departments/` | GET/POST/PUT/DELETE | 部门 CRUD 操作 |
|
||||
| `departments/{id}/` | DELETE | 删除部门(发送邮件通知) |
|
||||
| `finance_categories/` | GET/POST/PUT/DELETE | 财务分类 CRUD 操作 |
|
||||
| `finance/categories/`(原 `finance_categories/`) | GET/POST/PUT/DELETE | 财务分类 CRUD 操作 |
|
||||
| `proof-images/` | GET/POST/PUT/DELETE | 财务凭证图片 CRUD 操作 |
|
||||
| `proof-images/{id}/` | DELETE | 删除凭证图片(自动删除物理文件) |
|
||||
|
||||
|
||||
+29
-11
@@ -1,11 +1,29 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/department")
|
||||
class DepartmentsController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/departments")
|
||||
class DepartmentsController {
|
||||
|
||||
// departments/ GET/POST/PUT/DELETE 部门 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getDepartments(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createDepartment(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updateDepartment(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deleteDepartment(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// departments/{id}/ DELETE 删除部门(发送邮件通知)
|
||||
@DeleteMapping("/{id}", "/{id}/")
|
||||
fun deleteById(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
+23
-11
@@ -1,11 +1,23 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/email")
|
||||
class EmailController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/email")
|
||||
class EmailController {
|
||||
|
||||
// notification-settings/ GET/POST 获取/更新通知设置和邮箱列表
|
||||
@GetMapping("/notification-settings", "/notification-settings/")
|
||||
fun getNotificationSettings(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("/notification-settings", "/notification-settings/")
|
||||
fun updateNotificationSettings(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// toggle-email-status/ POST 切换邮箱启用/禁用状态
|
||||
@PostMapping("/toggle-email-status", "/toggle-email-status/")
|
||||
fun toggleEmailStatus(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
+49
-11
@@ -1,11 +1,49 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/evaluation-records")
|
||||
class EvaluationRecordsController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/evaluation-records")
|
||||
class EvaluationRecordsController {
|
||||
|
||||
// evaluation-records/ GET/POST/PUT/DELETE 考评记录 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getRecords(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createRecord(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updateRecord(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deleteRecord(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// evaluation-records/personnel-summary/ GET 获取人员考评汇总
|
||||
@GetMapping("/personnel-summary", "/personnel-summary/")
|
||||
fun getPersonnelSummary(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// evaluation-records/personnel-records/ GET 获取某个人员的所有考评记录
|
||||
@GetMapping("/personnel-records", "/personnel-records/")
|
||||
fun getPersonnelRecords(@RequestParam(required = false) personId: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// evaluation-records/delete-personnel/ DELETE 删除某个人员的所有考评记录
|
||||
@DeleteMapping("/delete-personnel", "/delete-personnel/")
|
||||
fun deletePersonnelRecords(@RequestParam(required = false) personId: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// evaluation-records/export/ GET 导出考评记录为 Excel
|
||||
@GetMapping("/export", "/export/")
|
||||
fun exportRecords(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// evaluation-records/download-template/ GET 下载人员导入样表
|
||||
@GetMapping("/download-template", "/download-template/")
|
||||
fun downloadTemplate(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// evaluation-records/import/ POST 导入考评记录
|
||||
@PostMapping("/import", "/import/")
|
||||
fun importRecords(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
+46
-11
@@ -1,11 +1,46 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/finance")
|
||||
class FinanceController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/finance")
|
||||
class FinanceController {
|
||||
|
||||
// finance/ GET/POST/PUT/DELETE 财务记录 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getFinanceRecords(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createFinanceRecord(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updateFinanceRecord(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deleteFinanceRecord(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// finance/{id}/upload_images/ POST 上传财务凭证图片
|
||||
@PostMapping("/{id}/upload_images", "/{id}/upload_images/")
|
||||
fun uploadImages(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// finance/{id}/ DELETE 删除财务记录(发送邮件通知)
|
||||
@DeleteMapping("/{id}", "/{id}/")
|
||||
fun deleteById(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// finance/categories/ GET/POST/PUT/DELETE 财务分类 CRUD 操作
|
||||
@GetMapping("/categories", "/categories/")
|
||||
fun getFinanceCategories(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("/categories", "/categories/")
|
||||
fun createFinanceCategory(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("/categories", "/categories/")
|
||||
fun updateFinanceCategory(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("/categories", "/categories/")
|
||||
fun deleteFinanceCategory(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
+67
-3
@@ -1,11 +1,75 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/items")
|
||||
class ItemsController {
|
||||
}
|
||||
|
||||
// items/ GET/POST/PUT/DELETE 物品 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getItems(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createItem(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updateItem(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deleteItem(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// items/{id}/upload_images/ POST 上传物品图片
|
||||
@PostMapping("/{id}/upload_images", "/{id}/upload_images/")
|
||||
fun uploadImages(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// items/{id}/set_primary_image/ POST 设置主图片
|
||||
@PostMapping("/{id}/set_primary_image", "/{id}/set_primary_image/")
|
||||
fun setPrimaryImage(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// items/{id}/borrow/ POST 借用物品
|
||||
@PostMapping("/{id}/borrow", "/{id}/borrow/")
|
||||
fun borrowItem(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// items/{id}/return_item/ POST 归还物品
|
||||
@PostMapping("/{id}/return_item", "/{id}/return_item/")
|
||||
fun returnItem(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// items/available/ GET 获取可用物品列表
|
||||
@GetMapping("/available", "/available/")
|
||||
fun getAvailableItems(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// items/in_use/ GET 获取使用中的物品列表
|
||||
@GetMapping("/in_use", "/in_use/")
|
||||
fun getInUseItems(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// items/categories/ GET/POST/PUT/DELETE 物品类别 CRUD 操作
|
||||
@GetMapping("/categories", "/categories/")
|
||||
fun getItemCategories(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("/categories", "/categories/")
|
||||
fun createItemCategory(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("/categories", "/categories/")
|
||||
fun updateItemCategory(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("/categories", "/categories/")
|
||||
fun deleteItemCategory(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// items/images/ GET/POST/PUT/DELETE 物品图片 CRUD 操作
|
||||
@GetMapping("/images", "/images/")
|
||||
fun getItemImages(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("/images", "/images/")
|
||||
fun createItemImage(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("/images", "/images/")
|
||||
fun updateItemImage(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("/images", "/images/")
|
||||
fun deleteItemImage(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
|
||||
+33
-11
@@ -1,11 +1,33 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/memos")
|
||||
class MemosController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/memos")
|
||||
class MemosController {
|
||||
|
||||
// memos/ GET/POST/PUT/DELETE 备忘录 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getMemos(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createMemo(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updateMemo(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deleteMemo(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// memos/{id}/upload_image/ POST 上传备忘录图片
|
||||
@PostMapping("/{id}/upload_image", "/{id}/upload_image/")
|
||||
fun uploadImage(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// memos/{id}/delete_image/ DELETE 删除备忘录图片
|
||||
@DeleteMapping("/{id}/delete_image", "/{id}/delete_image/")
|
||||
fun deleteImage(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
+45
-11
@@ -1,11 +1,45 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/personnel")
|
||||
class PersonnelController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/personnel")
|
||||
class PersonnelController {
|
||||
|
||||
// personnel/ GET/POST/PUT/DELETE 人员信息 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getPersonnel(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createPersonnel(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updatePersonnel(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deletePersonnel(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// personnel/statistics/ GET 获取人员统计信息(按部门和职位)
|
||||
@GetMapping("/statistics", "/statistics/")
|
||||
fun getStatistics(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// personnel/{id}/set_inactive/ POST 设置人员为已卸任状态
|
||||
@PostMapping("/{id}/set_inactive", "/{id}/set_inactive/")
|
||||
fun setInactive(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// personnel/{id}/set_active/ POST 设置人员为在职状态
|
||||
@PostMapping("/{id}/set_active", "/{id}/set_active/")
|
||||
fun setActive(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// personnel/{id}/ DELETE 删除人员(发送邮件通知)
|
||||
@DeleteMapping("/{id}", "/{id}/")
|
||||
fun deleteById(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// personnel/check_expired/ POST 检查并更新已到期的人员状态
|
||||
@PostMapping("/check_expired", "/check_expired/")
|
||||
fun checkExpired(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
+33
-11
@@ -1,11 +1,33 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/project-groups")
|
||||
class ProjectGroupsController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/project-groups")
|
||||
class ProjectGroupsController {
|
||||
|
||||
// project-groups/ GET/POST/PUT/DELETE 项目组 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getProjectGroups(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createProjectGroup(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updateProjectGroup(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deleteProjectGroup(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// project-groups/by_department/ GET 按部门获取项目组
|
||||
@GetMapping("/by_department", "/by_department/")
|
||||
fun getByDepartment(@RequestParam(required = false) departmentId: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// project-groups/{id}/ DELETE 删除项目组(发送邮件通知)
|
||||
@DeleteMapping("/{id}", "/{id}/")
|
||||
fun deleteById(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
+29
-11
@@ -1,11 +1,29 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/proof-images")
|
||||
class ProofImagesController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/proof-images")
|
||||
class ProofImagesController {
|
||||
|
||||
// proof-images/ GET/POST/PUT/DELETE 财务凭证图片 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getProofImages(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createProofImage(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updateProofImage(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deleteProofImage(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// proof-images/{id}/ DELETE 删除凭证图片(自动删除物理文件)
|
||||
@DeleteMapping("/{id}", "/{id}/")
|
||||
fun deleteById(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
+50
-11
@@ -1,11 +1,50 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/usages")
|
||||
class UsagesController {
|
||||
}
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/usages")
|
||||
class UsagesController {
|
||||
|
||||
// usages/ GET/POST/PUT/DELETE 物品使用记录 CRUD 操作
|
||||
@GetMapping("", "/")
|
||||
fun getUsages(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("", "/")
|
||||
fun createUsage(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("", "/")
|
||||
fun updateUsage(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("", "/")
|
||||
fun deleteUsage(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// usages/{id}/upload_images/ POST 上传使用记录图片
|
||||
@PostMapping("/{id}/upload_images", "/{id}/upload_images/")
|
||||
fun uploadImages(@PathVariable("id") id: String): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// usages/current/ GET 获取当前使用中的记录
|
||||
@GetMapping("/current", "/current/")
|
||||
fun getCurrentUsages(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// usages/by_user/ GET 根据用户姓名获取使用记录
|
||||
@GetMapping("/by_user", "/by_user/")
|
||||
fun getUsagesByUser(@RequestParam(required = false) name: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
// usages/images/ GET/POST/PUT/DELETE 使用记录图片 CRUD 操作
|
||||
@GetMapping("/images", "/images/")
|
||||
fun getUsageImages(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PostMapping("/images", "/images/")
|
||||
fun createUsageImage(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@PutMapping("/images", "/images/")
|
||||
fun updateUsageImage(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
|
||||
@DeleteMapping("/images", "/images/")
|
||||
fun deleteUsageImage(@RequestParam(required = false) id: String?): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package club.itstudio.itmanager.controller.v1
|
||||
|
||||
import club.itstudio.itmanager.utils.Const
|
||||
import org.springframework.validation.annotation.Validated
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/users")
|
||||
class UsersController {
|
||||
|
||||
// users/ GET 获取用户列表(只读)
|
||||
@GetMapping("", "/")
|
||||
fun getUsers(): Mono<String> = Const.INTERNAL_ERROR_MONO
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package club.itstudio.itmanager.utils
|
||||
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
object Const {
|
||||
const val FLOW_LIMIT_ORDER = -101
|
||||
|
||||
@@ -9,4 +11,6 @@ object Const {
|
||||
|
||||
const val FLOW_LIMIT_COUNTER = "flow:counter:"
|
||||
const val FLOW_LIMIT_BLOCK = "flow:block:"
|
||||
|
||||
val INTERNAL_ERROR_MONO = Mono.just("something went wrong. Please contact the administrator.")
|
||||
}
|
||||
Reference in New Issue
Block a user