从零到完成安卓项目实战【安卓端+后端】

简介: 因为平时自己喜欢打篮球,那就开发一个篮球相关的系统吧:NBA安卓系统。

因为平时自己喜欢打篮球,那就开发一个篮球相关的系统吧:NBA安卓系统。


一,功能介绍


APP主要具备网上篮球约球、篮球交流、线上NBA观赛,力求软件界面友好、功能齐全、可拓展性良好。


系统的功能有:交流评论区模块、场馆预约模块、网上约球模块、约球留言模块、线上观赛模块、NBA球员分析模块。


通过线上篮球约球、球友交流评论、NBA比赛观看等功能,打造一款“线上观赛+线下实战”的篮球交友APP,帮助一些喜欢篮球运动的青少年可以随时随地观赛、组队、交流、交友。


二,开发语言介绍


APP基于JAVA语言进行开发,后台数据的存储采用 MySql 结合 Reids 实现数据存储,移动端通过 AndroidStudio 开发。


三,系统的界面介绍


微信图片_20221009225449.png


微信图片_20221009225459.png


微信图片_20221009225504.jpg


微信图片_20221009225510.jpg


微信图片_20221009225515.jpg


微信图片_20221009225521.jpg


微信图片_20221009225526.jpg


微信图片_20221009225531.jpg


微信图片_20221009225535.jpg


微信图片_20221009225540.jpg


微信图片_20221009225545.jpg


微信图片_20221009225550.jpg


四,核心代码演示


/**
 * 小孟v:jishulearn
 * Created by xiaomeng
 */
@Controller
@RequestMapping("/sys/dict")
public class DictionaryController extends BaseController {
    @Autowired
    private DictionaryService dictionaryService;
    @RequiresPermissions("sys:dict:view")
    @RequestMapping()
    public String view() {
        return "system/dictionary.html";
    }
    /**
     * 分页查询字典
     */
    @OperLog(value = "字典管理", desc = "分页查询")
    @RequiresPermissions("sys:dict:list")
    @ResponseBody
    @RequestMapping("/page")
    public PageResult<Dictionary> page(HttpServletRequest request) {
        PageParam<Dictionary> pageParam = new PageParam<>(request);
        return new PageResult<>(dictionaryService.page(pageParam, pageParam.getWrapper()).getRecords(), pageParam.getTotal());
    }
    /**
     * 查询全部字典
     */
    @OperLog(value = "字典管理", desc = "查询全部")
    @RequiresPermissions("sys:dict:list")
    @ResponseBody
    @RequestMapping("/list")
    public JsonResult list(HttpServletRequest request) {
        PageParam<Dictionary> pageParam = new PageParam<>(request);
        return JsonResult.ok().setData(dictionaryService.list(pageParam.getOrderWrapper()));
    }
    /**
     * 根据id查询字典
     */
    @OperLog(value = "字典管理", desc = "根据id查询")
    @RequiresPermissions("sys:dict:list")
    @ResponseBody
    @RequestMapping("/get")
    public JsonResult get(Integer id) {
        return JsonResult.ok().setData(dictionaryService.getById(id));
    }
    /**
     * 添加字典
     */
    @OperLog(value = "字典管理", desc = "添加", param = false, result = true)
    @RequiresPermissions("sys:dict:save")
    @ResponseBody
    @RequestMapping("/save")
    public JsonResult save(Dictionary dictionary) {
        if (dictionaryService.count(new QueryWrapper<Dictionary>().eq("dict_code", dictionary.getDictCode())) > 0) {
            return JsonResult.error("字典标识已存在");
        }
        if (dictionaryService.count(new QueryWrapper<Dictionary>().eq("dict_name", dictionary.getDictName())) > 0) {
            return JsonResult.error("字典名称已存在");
        }
        if (dictionaryService.save(dictionary)) {
            return JsonResult.ok("添加成功");
        }
        return JsonResult.error("添加失败");
    }
    /**
     * 修改字典
     */
    @OperLog(value = "字典管理", desc = "修改", param = false, result = true)
    @RequiresPermissions("sys:dict:update")
    @ResponseBody
    @RequestMapping("/update")
    public JsonResult update(Dictionary dictionary) {
        if (dictionaryService.count(new QueryWrapper<Dictionary>().eq("dict_code", dictionary.getDictCode())
                .ne("dict_id", dictionary.getDictId())) > 0) {
            return JsonResult.error("字典代码已存在");
        }
        if (dictionaryService.count(new QueryWrapper<Dictionary>().eq("dict_name", dictionary.getDictName())
                .ne("dict_id", dictionary.getDictId())) > 0) {
            return JsonResult.error("字典名称已存在");
        }
        if (dictionaryService.updateById(dictionary)) {
            return JsonResult.ok("修改成功");
        }
        return JsonResult.error("修改失败");
    }
    /**
     * 删除字典
     */
    @OperLog(value = "字典管理", desc = "删除", result = true)
    @RequiresPermissions("sys:dict:remove")
    @ResponseBody
    @RequestMapping("/remove")
    public JsonResult remove(Integer id) {
        if (dictionaryService.removeById(id)) {
            return JsonResult.ok("删除成功");
        }
        return JsonResult.error("删除失败");
    }
    /**
     * 批量添加字典
     */
    @OperLog(value = "字典管理", desc = "批量添加", param = false, result = true)
    @RequiresPermissions("sys:dict:save")
    @ResponseBody
    @RequestMapping("/saveBatch")
    public JsonResult saveBatch(@RequestBody List<Dictionary> list) {
        // 对集合本身进行非空和重复校验
        StringBuilder sb = new StringBuilder();
        sb.append(CoreUtil.listCheckBlank(list, "dictCode", "字典标识"));
        sb.append(CoreUtil.listCheckBlank(list, "dictName", "字典名称"));
        sb.append(CoreUtil.listCheckRepeat(list, "dictCode", "字典标识"));
        sb.append(CoreUtil.listCheckRepeat(list, "dictName", "字典名称"));
        if (sb.length() != 0) return JsonResult.error(sb.toString());
        // 数据库层面校验
        if (dictionaryService.count(new QueryWrapper<Dictionary>().in("dict_code",
                list.stream().map(Dictionary::getDictCode).collect(Collectors.toList()))) > 0) {
            return JsonResult.error("字典标识已存在");
        }
        if (dictionaryService.count(new QueryWrapper<Dictionary>().in("dict_name",
                list.stream().map(Dictionary::getDictName).collect(Collectors.toList()))) > 0) {
            return JsonResult.error("字典名称已存在");
        }
        if (dictionaryService.saveBatch(list)) {
            return JsonResult.ok("添加成功");
        }
        return JsonResult.error("添加失败");
    }
    /**
     * 批量删除字典
     */
    @OperLog(value = "字典管理", desc = "批量删除", result = true)
    @RequiresPermissions("sys:dict:remove")
    @ResponseBody
    @RequestMapping("/removeBatch")
    public JsonResult removeBatch(@RequestBody List<Integer> ids) {
        if (dictionaryService.removeByIds(ids)) {
            return JsonResult.ok("删除成功");
        }
        return JsonResult.error("删除失败");
    }
}


/**
 * 小孟v:jishulearn
 * Created by xiaoemng
 */
@Controller
@RequestMapping("/sys/menu")
public class MenuController extends BaseController {
    @Autowired
    private MenuService menuService;
    @RequiresPermissions("sys:menu:view")
    @RequestMapping()
    public String view() {
        return "system/menu.html";
    }
    /**
     * 分页查询菜单
     */
    @OperLog(value = "菜单管理", desc = "分页查询")
    @RequiresPermissions("sys:menu:list")
    @ResponseBody
    @RequestMapping("/page")
    public PageResult<Menu> page(HttpServletRequest request) {
        PageParam<Menu> pageParam = new PageParam<>(request);
        pageParam.setDefaultOrder(new String[]{"sort_number"}, null);
        return menuService.listPage(pageParam);
    }
    /**
     * 查询全部菜单
     */
    @OperLog(value = "菜单管理", desc = "查询全部")
    @RequiresPermissions("sys:menu:list")
    @ResponseBody
    @RequestMapping("/list")
    public JsonResult list(HttpServletRequest request) {
        PageParam<Menu> pageParam = new PageParam<>(request);
        pageParam.setDefaultOrder(new String[]{"sort_number"}, null);
        return JsonResult.ok().setData(menuService.list(pageParam.getOrderWrapper()));
    }
    /**
     * 根据id查询菜单
     */
    @OperLog(value = "菜单管理", desc = "根据id查询")
    @RequiresPermissions("sys:menu:list")
    @ResponseBody
    @RequestMapping("/get")
    public JsonResult get(Integer id) {
        return JsonResult.ok().setData(menuService.getById(id));
    }
    /**
     * 添加菜单
     */
    @OperLog(value = "菜单管理", desc = "添加", param = false, result = true)
    @RequiresPermissions("sys:menu:save")
    @ResponseBody
    @RequestMapping("/save")
    public JsonResult save(Menu menu) {
        if (menuService.save(menu)) {
            return JsonResult.ok("添加成功");
        }
        return JsonResult.error("添加失败");
    }
    /**
     * 修改菜单
     */
    @OperLog(value = "菜单管理", desc = "修改", param = false, result = true)
    @RequiresPermissions("sys:menu:update")
    @ResponseBody
    @RequestMapping("/update")
    public JsonResult update(Menu menu) {
        if (menuService.updateById(menu)) {
            return JsonResult.ok("修改成功");
        }
        return JsonResult.error("修改失败");
    }
    /**
     * 删除菜单
     */
    @OperLog(value = "菜单管理", desc = "删除", result = true)
    @RequiresPermissions("sys:menu:remove")
    @ResponseBody
    @RequestMapping("/remove")
    public JsonResult remove(Integer id) {
        if (menuService.removeById(id)) {
            return JsonResult.ok("删除成功");
        }
        return JsonResult.error("删除失败");
    }
    /**
     * 批量添加菜单
     */
    @OperLog(value = "菜单管理", desc = "批量添加", param = false, result = true)
    @RequiresPermissions("sys:menu:save")
    @ResponseBody
    @RequestMapping("/saveBatch")
    public JsonResult saveBatch(@RequestBody List<Menu> menuList) {
        if (menuService.saveBatch(menuList)) {
            return JsonResult.ok("添加成功");
        }
        return JsonResult.error("添加失败");
    }
    /**
     * 批量修改菜单
     */
    @OperLog(value = "菜单管理", desc = "批量修改", result = true)
    @RequiresPermissions("sys:menu:update")
    @ResponseBody
    @RequestMapping("/updateBatch")
    public JsonResult updateBatch(@RequestBody BatchParam<Menu> batchParam) {
        if (batchParam.update(menuService, "menu_id")) {
            return JsonResult.ok("修改成功");
        }
        return JsonResult.error("修改失败");
    }
    /**
     * 批量删除菜单
     */
    @OperLog(value = "菜单管理", desc = "批量删除", result = true)
    @RequiresPermissions("sys:menu:remove")
    @ResponseBody
    @RequestMapping("/removeBatch")
    public JsonResult removeBatch(@RequestBody List<Integer> ids) {
        if (menuService.removeByIds(ids)) {
            return JsonResult.ok("删除成功");
        }
        return JsonResult.error("删除失败");
    }
}


/**
 * 小孟v:jishulearn
 * Created by xiaomeng
 */
@Controller
@RequestMapping("/sys/operRecord")
public class OperRecordController extends BaseController {
    @Autowired
    private OperRecordService operLogService;
    @RequiresPermissions("sys:oper_record:view")
    @RequestMapping()
    public String view() {
        return "system/oper-record.html";
    }
    /**
     * 分页查询操作日志
     */
    @OperLog(value = "操作日志", desc = "分页查询")
    @RequiresPermissions("sys:oper_record:view")
    @ResponseBody
    @RequestMapping("/page")
    public PageResult<OperRecord> page(HttpServletRequest request) {
        PageParam<OperRecord> pageParam = new PageParam<>(request);
        pageParam.setDefaultOrder(null, new String[]{"create_time"});
        return operLogService.listPage(pageParam);
    }
    /**
     * 查询全部操作日志
     */
    @OperLog(value = "操作日志", desc = "查询全部")
    @RequiresPermissions("sys:oper_record:view")
    @ResponseBody
    @RequestMapping("/list")
    public JsonResult list(HttpServletRequest request) {
        PageParam<OperRecord> pageParam = new PageParam<>(request);
        List<OperRecord> records = operLogService.listAll(pageParam.getNoPageParam());
        return JsonResult.ok().setData(pageParam.sortRecords(records));
    }
    /**
     * 根据id查询操作日志
     */
    @OperLog(value = "操作日志", desc = "根据id查询")
    @RequiresPermissions("sys:oper_record:view")
    @ResponseBody
    @RequestMapping("/get")
    public JsonResult get(Integer id) {
        PageParam<OperRecord> pageParam = new PageParam<>();
        pageParam.put("id", id);
        List<OperRecord> records = operLogService.listAll(pageParam.getNoPageParam());
        return JsonResult.ok().setData(pageParam.getOne(records));
    }
}
相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
目录
相关文章
|
4天前
|
前端开发 Android开发
Android架构组件JetPack之DataBinding玩转MVVM开发实战(四)
Android架构组件JetPack之DataBinding玩转MVVM开发实战(四)
Android架构组件JetPack之DataBinding玩转MVVM开发实战(四)
|
4天前
|
Android开发
Android高级开发面试题以及笞案整理,实战解析
Android高级开发面试题以及笞案整理,实战解析
|
4天前
|
Android开发
Android Jetpack架构开发组件化应用实战,字节跳动+阿里+华为+腾讯等大厂Android面试题
Android Jetpack架构开发组件化应用实战,字节跳动+阿里+华为+腾讯等大厂Android面试题
|
5天前
|
Android开发
Flutter完整开发实战详解(六、 深入Widget原理),2024百度Android岗面试真题收录解析
Flutter完整开发实战详解(六、 深入Widget原理),2024百度Android岗面试真题收录解析
|
5天前
|
设计模式 Android开发 Java
实战案例,精选Android面试真题集锦
实战案例,精选Android面试真题集锦
|
6天前
|
缓存 Java Android开发
Android应用性能优化实战
【5月更文挑战第14天】 在竞争激烈的应用市场中,一个流畅、高效的应用能显著提升用户体验并增强用户黏性。本文深入探讨了针对安卓平台进行应用性能优化的策略与实践,从内存管理到多线程处理,再到布局渲染和网络请求的优化,旨在为开发者提供一套全面的优化工具箱。通过分析常见的性能瓶颈并结合最新的Android技术动态,我们不仅讨论理论,还将分享具体的代码示例和改进方法,帮助开发者在实际应用中实现性能提升。
|
6天前
|
编解码 缓存 监控
安卓应用性能优化实战
【5月更文挑战第14天】 在当今移动应用竞争激烈的市场中,一款应用的性能直接影响用户体验和留存率。特别是对于安卓平台,由于设备多样性和应用生态环境的复杂性,性能优化显得尤为重要。本文将深入探讨安卓应用的性能瓶颈,分析影响性能的关键因素,并通过具体的代码实践和工具使用,展示如何有效提升安卓应用的响应速度和流畅度。内容覆盖从UI渲染优化、内存管理到电池使用效率的多个方面,旨在为开发者提供一套实用的性能优化策略。
|
6天前
|
缓存 JSON 安全
【Uniapp 专栏】Uniapp 与后端接口对接的实战要点
【5月更文挑战第12天】在 Uniapp 项目开发中,成功对接后端接口至关重要。要点包括:深入理解后端提供的接口文档,确保数据格式(如 JSON)正确处理,选择合适的请求方式(如 GET、POST),设置正确的请求头,做好错误处理和数据缓存策略,确保安全性(如使用 HTTPS 和令牌验证)并进行全面测试。同时,进行版本管理和团队协作,与后端开发人员保持良好沟通,以实现高效、稳定的接口对接。
|
6天前
|
机器学习/深度学习 算法 安全
深度学习在图像识别中的应用与挑战构建高效可扩展的RESTful API:后端开发的实战指南
【4月更文挑战第30天】 随着计算机视觉技术的飞速发展,深度学习在图像识别领域取得了显著的成果。本文将探讨深度学习技术在图像识别中的应用及其所面临的挑战。首先,我们将介绍深度学习的基本原理和关键技术,然后分析其在图像识别中的优势和应用案例。最后,我们将讨论当前深度学习在图像识别领域所面临的主要挑战和未来的发展趋势。
|
6天前
|
移动开发 API Android开发
Android应用性能优化实战
【4月更文挑战第28天】在移动开发领域,一个流畅的用户体验是至关重要的。对于Android开发者而言,应用的性能优化是一项既挑战性也极其重要的工作。本文将深入探讨Android应用性能优化的多个方面,包括内存管理、UI渲染、多线程处理以及电池效率等,旨在为开发者提供实用的性能提升策略和具体的实施步骤。通过分析常见的性能瓶颈,并结合最新的Android系统特性和工具,我们的目标是帮助读者打造更加高效、响应迅速的Android应用。

推荐镜像

更多