1
This commit is contained in:
@@ -2,12 +2,14 @@ package com.ga.api;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
|
||||
/**
|
||||
* GA 수수료 정산 API 서버.
|
||||
* 컴포넌트 스캔: com.ga 패키지 (common/core/api 모두 포함)
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = {"com.ga"})
|
||||
@EnableCaching
|
||||
public class GaApiApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GaApiApplication.class, args);
|
||||
|
||||
@@ -24,20 +24,20 @@ public class InstallmentController {
|
||||
private final InstallmentService installmentService;
|
||||
|
||||
@GetMapping
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "READ")
|
||||
@RequirePermission(menu = "INSTALLMENT_PLAN", perm = "READ")
|
||||
public ApiResponse<PageResponse<InstallmentPlanResp>> list(InstallmentPlanSearchParam param) {
|
||||
return ApiResponse.ok(installmentService.list(param));
|
||||
}
|
||||
|
||||
@GetMapping("/{planId}")
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "READ")
|
||||
@RequirePermission(menu = "INSTALLMENT_PLAN", perm = "READ")
|
||||
public ApiResponse<InstallmentPlanResp> detail(@PathVariable Long planId) {
|
||||
return ApiResponse.ok(installmentService.detail(planId));
|
||||
}
|
||||
|
||||
@PostMapping("/generate")
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "CREATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT", table = "installment_plan")
|
||||
@RequirePermission(menu = "INSTALLMENT_PLAN", perm = "CREATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT_PLAN", table = "installment_plan")
|
||||
public ApiResponse<Void> generate(@Valid @RequestBody GeneratePlanReq req) {
|
||||
installmentService.createPlan(
|
||||
req.getContractId(),
|
||||
@@ -49,8 +49,8 @@ public class InstallmentController {
|
||||
}
|
||||
|
||||
@PutMapping("/{planId}/pay")
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "UPDATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT", table = "installment_plan")
|
||||
@RequirePermission(menu = "INSTALLMENT_PLAN", perm = "UPDATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT_PLAN", table = "installment_plan")
|
||||
public ApiResponse<Void> pay(@PathVariable Long planId,
|
||||
@Valid @RequestBody PayPlanReq req) {
|
||||
installmentService.payPlan(planId, req.getPaymentId(), req.getPaidAmount());
|
||||
@@ -58,23 +58,23 @@ public class InstallmentController {
|
||||
}
|
||||
|
||||
@PutMapping("/{planId}/defer")
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "UPDATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT", table = "installment_plan")
|
||||
@RequirePermission(menu = "INSTALLMENT_PLAN", perm = "UPDATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT_PLAN", table = "installment_plan")
|
||||
public ApiResponse<Void> defer(@PathVariable Long planId) {
|
||||
installmentService.deferPlan(planId);
|
||||
return ApiResponse.ok();
|
||||
}
|
||||
|
||||
@PutMapping("/{planId}/cancel")
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "UPDATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT", table = "installment_plan")
|
||||
@RequirePermission(menu = "INSTALLMENT_PLAN", perm = "UPDATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT_PLAN", table = "installment_plan")
|
||||
public ApiResponse<Void> cancel(@PathVariable Long planId) {
|
||||
installmentService.cancelPlan(planId);
|
||||
return ApiResponse.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/scheduled")
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "READ")
|
||||
@RequirePermission(menu = "INSTALLMENT_PLAN", perm = "READ")
|
||||
public ApiResponse<List<InstallmentPlanVO>> scheduled(@RequestParam String settleMonth) {
|
||||
return ApiResponse.ok(installmentService.selectScheduledForMonth(settleMonth));
|
||||
}
|
||||
|
||||
+3
-3
@@ -22,14 +22,14 @@ public class InstallmentRatioController {
|
||||
private final InstallmentService installmentService;
|
||||
|
||||
@GetMapping
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "READ")
|
||||
@RequirePermission(menu = "INSTALLMENT_RATIO", perm = "READ")
|
||||
public ApiResponse<PageResponse<InstallmentRatioResp>> list(InstallmentRatioSearchParam param) {
|
||||
return ApiResponse.ok(installmentService.listRatios(param));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@RequirePermission(menu = "INSTALLMENT", perm = "CREATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT", table = "installment_ratio")
|
||||
@RequirePermission(menu = "INSTALLMENT_RATIO", perm = "CREATE")
|
||||
@DataChangeLog(menu = "INSTALLMENT_RATIO", table = "installment_ratio")
|
||||
public ApiResponse<Void> create(@Valid @RequestBody InstallmentRatioSaveReq req) {
|
||||
installmentService.createRatio(req);
|
||||
return ApiResponse.ok();
|
||||
|
||||
@@ -25,41 +25,41 @@ public class SettleCorrectionController {
|
||||
private final SettleCorrectionService service;
|
||||
|
||||
@GetMapping
|
||||
@RequirePermission(menu = "SETTLE_CORR", perm = "READ")
|
||||
@RequirePermission(menu = "SETTLE_CORRECTION", perm = "READ")
|
||||
public ApiResponse<PageResponse<SettleCorrectionResp>> list(@ModelAttribute SettleCorrectionSearchParam param) {
|
||||
return ApiResponse.ok(service.list(param));
|
||||
}
|
||||
|
||||
@GetMapping("/{correctionId}")
|
||||
@RequirePermission(menu = "SETTLE_CORR", perm = "READ")
|
||||
@RequirePermission(menu = "SETTLE_CORRECTION", perm = "READ")
|
||||
public ApiResponse<SettleCorrectionResp> detail(@PathVariable Long correctionId) {
|
||||
return ApiResponse.ok(service.detail(correctionId));
|
||||
}
|
||||
|
||||
@GetMapping("/by-settle/{originalSettleId}")
|
||||
@RequirePermission(menu = "SETTLE_CORR", perm = "READ")
|
||||
@RequirePermission(menu = "SETTLE_CORRECTION", perm = "READ")
|
||||
public ApiResponse<List<SettleCorrectionResp>> listByOriginalSettle(@PathVariable Long originalSettleId) {
|
||||
return ApiResponse.ok(service.listByOriginalSettle(originalSettleId));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@RequirePermission(menu = "SETTLE_CORR", perm = "CREATE")
|
||||
@DataChangeLog(menu = "SETTLE_CORR", table = "settle_correction")
|
||||
@RequirePermission(menu = "SETTLE_CORRECTION", perm = "CREATE")
|
||||
@DataChangeLog(menu = "SETTLE_CORRECTION", table = "settle_correction")
|
||||
public ApiResponse<Long> create(@Valid @RequestBody SettleCorrectionSaveReq req) {
|
||||
return ApiResponse.ok(service.create(req));
|
||||
}
|
||||
|
||||
@PostMapping("/{correctionId}/approve")
|
||||
@RequirePermission(menu = "SETTLE_CORR", perm = "APPROVE")
|
||||
@DataChangeLog(menu = "SETTLE_CORR", table = "settle_correction")
|
||||
@RequirePermission(menu = "SETTLE_CORRECTION", perm = "APPROVE")
|
||||
@DataChangeLog(menu = "SETTLE_CORRECTION", table = "settle_correction")
|
||||
public ApiResponse<Void> approve(@PathVariable Long correctionId) {
|
||||
service.approve(correctionId);
|
||||
return ApiResponse.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/{correctionId}/cancel")
|
||||
@RequirePermission(menu = "SETTLE_CORR", perm = "UPDATE")
|
||||
@DataChangeLog(menu = "SETTLE_CORR", table = "settle_correction")
|
||||
@RequirePermission(menu = "SETTLE_CORRECTION", perm = "UPDATE")
|
||||
@DataChangeLog(menu = "SETTLE_CORRECTION", table = "settle_correction")
|
||||
public ApiResponse<Void> cancel(@PathVariable Long correctionId, @RequestBody Map<String, String> body) {
|
||||
service.cancel(correctionId, body.get("cancelReason"));
|
||||
return ApiResponse.ok();
|
||||
|
||||
Reference in New Issue
Block a user