package com.yiqi.app.service.impl;

import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.yiqi.common.utils.DateUtils;
import com.yiqi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiqi.app.mapper.AppVersionMapper;
import com.yiqi.app.domain.AppVersion;
import com.yiqi.app.service.IAppVersionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * APP版本管理Service业务层处理
 *
 * @author xiaohei
 * @date 2023-09-01
 */
@Service
public class AppVersionServiceImpl extends ServiceImpl<AppVersionMapper,AppVersion> implements IAppVersionService {

    /**
     * 查询APP版本管理
     *
     * @param id APP版本管理主键
     * @return APP版本管理
     */
    @Override
    public AppVersion selectAppVersionById(Long id) {
        return baseMapper.selectAppVersionById(id);
    }

    /**
     * 查询APP版本管理列表
     *
     * @param appVersion APP版本管理
     * @return APP版本管理
     */
    @Override
    public List<AppVersion> selectAppVersionList(AppVersion appVersion) {
        return baseMapper.selectAppVersionList(appVersion);
    }

    /**
     * 新增APP版本管理
     *
     * @param appVersion APP版本管理
     * @return 结果
     */
    @Override
    public int insertAppVersion(AppVersion appVersion) {
        appVersion.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertAppVersion(appVersion);
    }

    /**
     * 修改APP版本管理
     *
     * @param appVersion APP版本管理
     * @return 结果
     */
    @Override
    public int updateAppVersion(AppVersion appVersion) {
        appVersion.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateAppVersion(appVersion);
    }

    /**
     * 批量删除APP版本管理
     *
     * @param ids 需要删除的APP版本管理主键
     * @return 结果
     */
    @Override
    public int deleteAppVersionByIds(Long[] ids) {
        return baseMapper.deleteAppVersionByIds(ids);
    }

    /**
     * 删除APP版本管理信息
     *
     * @param id APP版本管理主键
     * @return 结果
     */
    @Override
    public int deleteAppVersionById(Long id) {
        return baseMapper.deleteAppVersionById(id);
    }

    public static void main(String[] args) {

        String input = "varchar(500)";
        String regex = "\\((.*?)\\)";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(input);

        if (matcher.find()) {
            String result = matcher.group(1);
            System.out.println("括号内的内容：" + result); // 输出：括号内的内容：World
        } else {
            System.out.println("未找到匹配项");
        }
    }



}
