package top.continew.admin.controller.business;

import com.alibaba.fastjson2.JSONObject;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.continew.admin.common.util.AiBotUtil;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
import top.continew.starter.web.model.R;

/**
 * @author 张波
 * @since 2024/10/26 17:39
 */
@Tag(name = "AI BOT接口")
@RestController
@RequestMapping("/aiBot")
public class AiBotController {

    @Operation(summary = "分页获取个人图库")
    @GetMapping(value = "/getImagePage")
    public PageResp<String> getImagePage(Boolean isAsc, PageQuery pageQuery) {
        return AiBotUtil.getImagePage(pageQuery.getPage(), pageQuery.getSize(), isAsc);
    }

    @Operation(summary = "获取图片拓展信息")
    @GetMapping(value = "/getImageExif")
    public R<JSONObject> getImageExif(String imageUrl) {
        return R.ok(AiBotUtil.getImageExif(imageUrl));
    }
}
