|
|
@@ -0,0 +1,63 @@
|
|
|
+package com.fs.web.controller.system;
|
|
|
+
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
+import com.fs.proxy.domain.TenantTrafficPricing;
|
|
|
+import com.fs.proxy.service.ITenantTrafficPricingService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 租户流量定价管理 Controller (adminUI)
|
|
|
+ * 对应前端 /admin/traffic-pricing/*
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/admin/traffic-pricing")
|
|
|
+public class TenantTrafficPricingController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITenantTrafficPricingService trafficPricingService;
|
|
|
+
|
|
|
+ /** 查询流量定价列表 */
|
|
|
+ @PreAuthorize("@ss.hasPermi('platform:trafficPricing:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(TenantTrafficPricing query) {
|
|
|
+ startPage();
|
|
|
+ List<TenantTrafficPricing> list = trafficPricingService.selectList(query);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 查询流量定价详情 */
|
|
|
+ @PreAuthorize("@ss.hasPermi('platform:trafficPricing:list')")
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable Long id) {
|
|
|
+ return AjaxResult.success(trafficPricingService.selectById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 新增流量定价 */
|
|
|
+ @PreAuthorize("@ss.hasPermi('platform:trafficPricing:add')")
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody TenantTrafficPricing record) {
|
|
|
+ record.setCreateBy(getUsername());
|
|
|
+ return toAjax(trafficPricingService.insert(record));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 修改流量定价 */
|
|
|
+ @PreAuthorize("@ss.hasPermi('platform:trafficPricing:edit')")
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody TenantTrafficPricing record) {
|
|
|
+ record.setUpdateBy(getUsername());
|
|
|
+ return toAjax(trafficPricingService.update(record));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 删除流量定价 */
|
|
|
+ @PreAuthorize("@ss.hasPermi('platform:trafficPricing:remove')")
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ public AjaxResult remove(@PathVariable Long id) {
|
|
|
+ return toAjax(trafficPricingService.deleteById(id));
|
|
|
+ }
|
|
|
+}
|