package com.mcwl.resource.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.core.domain.R;
import com.mcwl.resource.domain.ToActivity;
import com.mcwl.resource.domain.request.PlatForm;
import com.mcwl.resource.mapper.PlatFormMapper;
import com.mcwl.resource.service.PlatFormService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 平台官方app联系方式
 *
 * @Author：ChenYan
 * @Project：mcwl-ai
 * @Package：com.mcwl.resource.service.impl
 * @Filename：PlatFormServiceImpl
 * @Description TODO
 * @Date：2025/3/4 16:12
 */
@Service
public class PlatFormServiceImpl extends ServiceImpl<PlatFormMapper, PlatForm> implements PlatFormService {


    /**
     * 平台官方app联系方式列表
     *
     * @param
     * @return
     */
    @Override
    public List<PlatForm> listplatForm( ) {
        return baseMapper.listplatForm();
    }


    /**
     * 平台官方app联系方式详情
     *
     * @param platForm
     * @return
     */
    @ApiOperation(value = "详情")
    @PostMapping("finById")
    public R<ToActivity> finById(@RequestBody PlatForm platForm) {
        baseMapper.selectById(platForm.getId());
        return R.ok();
    }

    /**
     * 平台官方app联系方式添加
     *
     * @param platForm
     * @return
     */
    @ApiOperation(value = "添加")
    @PostMapping("add")
    public R<Object> add(@RequestBody PlatForm platForm) {
        baseMapper.insert(platForm);
        return R.ok();
    }

    /**
     * 平台官方app联系方式修改
     *
     * @param platForm
     * @return
     */
    @ApiOperation(value = "修改")
    @PostMapping("update")
    public R<Object> update(@RequestBody PlatForm platForm) {
        baseMapper.updateById(platForm);
        return R.ok();
    }

    /**
     * 平台官方app联系方式删除
     *
     * @param platForm
     * @return
     */
    @ApiOperation(value = "删除")
    @PostMapping("delete")
    public R<Object> delete(@RequestBody PlatForm platForm) {
        baseMapper.deleteById(platForm);
        return R.ok();
    }


}
