package com.qqchen.deploy.backend.deploy.api;

import com.qqchen.deploy.backend.deploy.dto.ApplicationDTO;
import com.qqchen.deploy.backend.deploy.dto.DevelopmentLanguageTypeDTO;
import com.qqchen.deploy.backend.deploy.entity.Application;
import com.qqchen.deploy.backend.deploy.query.ApplicationQuery;
import com.qqchen.deploy.backend.deploy.service.IApplicationService;
import com.qqchen.deploy.backend.framework.api.Response;
import com.qqchen.deploy.backend.framework.controller.BaseController;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "应用管理", description = "应用管理相关接口")
@RestController
@RequestMapping("/api/v1/applications")
public class ApplicationApiController extends BaseController<Application, ApplicationDTO, Long, ApplicationQuery> {

    @Resource
    private IApplicationService applicationService;
    @Override
    protected void exportData(HttpServletResponse response, List<ApplicationDTO> data) {
        // TODO: 实现导出逻辑
    }

    @GetMapping("/development-languages")
    public Response<List<DevelopmentLanguageTypeDTO>> getAllDevelopmentLanguageTypes() {
        return Response.success(applicationService.getAllDevelopmentLanguageTypes());
    }
}