Add technology stack management
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppTechStack;
|
||||
import com.ruoyi.app.service.IAppTechStackService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/app/techStack")
|
||||
public class AppTechStackController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAppTechStackService techStackService;
|
||||
|
||||
/** 小程序可选择的启用技术栈。 */
|
||||
@GetMapping("/options")
|
||||
public AjaxResult options()
|
||||
{
|
||||
return success(techStackService.selectEnabledAppTechStackList());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('app:techStack:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AppTechStack techStack)
|
||||
{
|
||||
startPage();
|
||||
List<AppTechStack> list = techStackService.selectAppTechStackList(techStack);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('app:techStack:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult detail(@PathVariable Long id)
|
||||
{
|
||||
return success(techStackService.selectAppTechStackById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('app:techStack:add')")
|
||||
@Log(title = "定制技术栈", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AppTechStack techStack)
|
||||
{
|
||||
techStack.setCreateBy(getUsername());
|
||||
techStack.setUpdateBy(getUsername());
|
||||
return toAjax(techStackService.insertAppTechStack(techStack));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('app:techStack:edit')")
|
||||
@Log(title = "定制技术栈", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AppTechStack techStack)
|
||||
{
|
||||
techStack.setUpdateBy(getUsername());
|
||||
return toAjax(techStackService.updateAppTechStack(techStack));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('app:techStack:remove')")
|
||||
@Log(title = "定制技术栈", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(techStackService.deleteAppTechStackByIds(ids));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user