请选择 进入手机版 | 继续访问电脑版

用Java写了一个小猪效果图:

回答|共 65 个

legs+

legs+ 发表于 2022-11-23 19:10:17| 字数 70 | 显示全部楼层

孤星11 发表于 2022-11-21 22:21
我最怕碰到C#,C语言的class,struct, union那些,不会啊。

我看的出,大家一起努力

legs+

legs+ 发表于 2022-11-23 19:12:49| 字数 581 | 显示全部楼层

  1. package com.example.demo.result;
  2. //实现响应的枚举类
  3. public enum ExceptionMsg {
  4.         SUCCESS("200", "操作成功"),
  5.         FAILED("999999","操作失败"),
  6.     ParamError("000001", "参数错误!"),
  7.     FileEmpty("000400","上传文件为空"),
  8.     LimitPictureSize("000401","图片大小必须小于2M"),
  9.     LimitPictureType("000402","图片格式必须为'jpg'、'png'、'jpge'、'gif'、'bmp'")
  10.     ;
  11.    private ExceptionMsg(String code, String msg) {
  12.         this.code = code;
  13.         this.msg = msg;
  14.     }
  15.     private String code;
  16.     private String msg;
  17.    
  18.         public String getCode() {
  19.                 return code;
  20.         }
  21.         public String getMsg() {
  22.                 return msg;
  23.         }

  24.    
  25. }
复制代码
没事,写了个枚举类

legs+

legs+ 发表于 2022-11-23 21:14:11| 字数 207 | 显示全部楼层

昨天,我在QQ上问老朱:“界面怎么没有以前那么清爽”
他的回答很经典:
冬烛之焰 2022/11/22 21:53:15
以前我也是界面控,但后来发现,一个论坛好不好,最主要看内容,界面过得去就行了,毕竟每个人的喜好都不一样


。。。
但是,我要说的是,随着互联网的快速发展,互联网产品也从“满足用户的单向浏览需求”发展为“满足用户的个性化信息获取及社交的需求”。随着5G时代的到来,会有越来越多的“不可思议”的场景被搬上互联网。

孤星11

孤星11 发表于 2022-11-24 15:08:00| 字数 69 | 显示全部楼层

legs+ 发表于 2022-11-23 19:12
没事,写了个枚举类

那个enum很好用,enum我也写过,比class更容易明白,更容易掌握。

legs+

legs+ 发表于 2022-11-24 16:36:07| 字数 240 | 显示全部楼层

legs+ 发表于 2022-11-23 21:14
昨天,我在QQ上问老朱:“界面怎么没有以前那么清爽”
他的回答很经典:

千人千面的问题很好解决:
在数据库中设立一个字段,用来保存个人喜好的UI的CSS地址,当然你可以用MySQL,但是用redis更好,响应更丝滑,顺便体验一下科技带来的快感!
...
假设:
一个1亿用户是否登录了网站,只需要用1或者0表示即可。
假设这1亿个用户每天都登录网站,每天最多只会产生1亿给值为1的数据(大概12MB),一个星期大概84MB。这样就减轻了数据库负担。

legs+

legs+ 发表于 2022-11-27 23:19:15| 字数 39 | 显示全部楼层

360截图20221127231743170.jpg




...
昨天构思的一个页面,用Google翻译成英文了,CSS有点拥挤,慢慢调!

legs+

legs+ 发表于 2022-12-14 23:11:26| 字数 16 | 显示全部楼层

360截图20221214230938294.jpg



今天,用最新版的AS写了一个钟表

legs+

legs+ 发表于 2022-12-14 23:15:38| 字数 1,082 | 显示全部楼层

  1. buildscript {
  2.     repositories {
  3.         maven{url 'http://maven.aliyun.com/nexus/content/groups/public/';allowInsecureProtocol = true}
  4.         maven { url "https://jitpack.io" }
  5.         //maven { url 'http://repo1.maven.org/maven2';allowInsecureProtocol = true}
  6.         google()
  7. //        jcenter()
  8.     }
  9.     dependencies {
  10.         classpath 'com.android.tools.build:gradle:7.3.1'
  11.     }
  12. }

  13. allprojects {
  14.     repositories {
  15.         jcenter()
  16.         maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
  17.         maven { url "https://jitpack.io" }
  18.         google()
  19.     }
  20. }
复制代码

  1. pluginManagement {
  2.     repositories {
  3.         maven { url "http://maven.aliyun.com/nexus/content/groups/public/" ;allowInsecureProtocol = true }
  4.         gradlePluginPortal()
  5.         google()
  6.         mavenCentral()
  7.         maven {
  8.             url "https://jitpack.io"
  9.         }
  10.         //maven { url 'http://repo1.maven.org/maven2';allowInsecureProtocol = true}
  11.     }
  12. }



  13. dependencyResolutionManagement {
  14.     repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) // or FAIL_ON_PROJECT_REPOS
  15.     repositories {
  16.         google()
  17.         mavenCentral()
  18.         jcenter() // Warning: this repository is going to shut down soon
  19.         maven { url 'https://maven.testfairy.com' }
  20.         maven { url 'https://example.com/maven' }
  21.     }
  22. }
  23. rootProject.name = "My Application"
  24. include ':app'
复制代码

孤星11

孤星11 发表于 2022-12-14 23:24:20| 字数 52 来自手机 | 显示全部楼层

legs+ 发表于 2022-12-14 23:11
今天,用最新版的AS写了一个钟表

哇,好棒,你会的我却不会。

legs+

legs+ 发表于 2022-12-16 22:24:05| 字数 1,950 | 显示全部楼层

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Title</title>
  6.     <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  7.     <script src="https://cdn.staticfile.org/vue-router/2.7.0/vue-router.min.js"></script>
  8.     <style>
  9.         #app{
  10.             text-align: center;
  11.         }
  12.         .container {
  13.             background-color: #73ffd6;
  14.             margin-top: 20px;
  15.             height: 300px;
  16.         }
  17.         .son{
  18.             margin-top: 30px;
  19.         }
  20.     </style>

  21. </head>
  22. <body>
  23. <div id="app">
  24.     <!-- 通过 router-link 标签来生成导航链接 -->
  25.     <router-link to="/home" tag="button">首页</router-link>
  26.     <router-link to="/list">列表</router-link>
  27.     <div class="container">
  28.         <!-- 将选中的路由渲染到 router-view 下-->
  29.         <router-view></router-view>
  30.     </div>
  31. </div>
  32. <template id="tmpl">
  33.     <div>
  34.         <h3>列表内容</h3>
  35.         <!-- 生成嵌套子路由地址 -->
  36.         <router-link to="/list/login">登录</router-link>
  37.         <router-link to="/list/register">注册</router-link>
  38.         <div class="son">
  39.             <!-- 生成嵌套子路由渲染节点 -->
  40.             <router-view></router-view>
  41.         </div>
  42.     </div>
  43. </template>
  44. <script>
  45.     // 1.定义路由跳转的组件模板
  46.     const home = {
  47.         template: '<div><h3>首页内容</h3></div>'
  48.     }
  49.     const list = {
  50.         template: '#tmpl'
  51.     }
  52.     const login = {
  53.         template: '<div> 登录页面内容</div>'
  54.     }

  55.     const register = {
  56.         template: '<div>注册页面内容</div>'
  57.     }
  58.     // 2.定义路由信息
  59.     const routes = [
  60.         // 路由重定向:当路径为/时,重定向到/home路由
  61.         {
  62.             path: '/',
  63.             redirect: '/home'
  64.         },
  65.         {
  66.             path: '/home',
  67.             component: home
  68.         },
  69.         {
  70.             path: '/list',
  71.             component: list,
  72.             //嵌套路由
  73.             children: [
  74.                 {
  75.                     path: 'login',
  76.                     component: login
  77.                 },
  78.                 {
  79.                     path: 'register',
  80.                     component: register
  81.                 },
  82.                 // 当路径为/list时,重定向到/list/login路径
  83.                 {
  84.                     path: '/list',
  85.                     redirect: '/list/login'
  86.                 }
  87.             ]
  88.         }
  89.     ]
  90.     const router = new VueRouter({
  91.         //mode: 'history', //使用 history 模式还是hash路由模式
  92.         routes
  93.     })
  94.     // 3.挂载到当前 Vue 实例上
  95.     const app = new Vue({
  96.         el: '#app',
  97.         data:{},
  98.         methods: {},
  99.         router: router
  100.     });
  101. </script>

  102. </body>
  103. </html>

复制代码
写了一个vue的路由,不知道网上能否找到在线运行的方法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则