Giter Site home page Giter Site logo

jce's Introduction

使用必读

第一步

//gradle 运行publishing task 吧依赖库发布到本地maven库中
Jce:
JcePlugin[publishToMavenLocal]
Jce:
JceLib[publishToMavenLocal]

第二步添加本地maven源

//project file settings.gradle
pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        mavenLocal() //非常重要,否则插件无法安装
    }
}

//或者
repositories {
    google()
    mavenCentral()
    gradlePluginPortal()
    mavenLocal() //非常重要,否则插件无法安装
}

第三步 安装插件

普通 gradle、kts 可以这样用

id("taf-jce") version "1.0.1"

android 可以这样用

//新款base
id 'taf-jce' version '1.0.1' apply false

//老式的项目base是这样的
buildscript {
    repositories {
        google()
        mavenLocal()
        mavenCentral()
        gradlePluginPortal()
    }
    dependencies {
        classpath("taf-jce:taf-jce.gradle.plugin:1.0.1")
    }
}

//app模块
plugins {
    id 'taf-jce'
}

可用注解

@Jce() @Tars @JceId() @TarsId()

注意看JceStruct里面有 servantName funcName等方法 可以用注解实现填空@Jce(funcName="阿巴巴")

code

@Jce
class LoginPack : JceStruct() {
    @TarsId(1)
    var userId: String = ""

    @TarsId(2)
    var password: String = ""

    @TarsId(id = 3, require = true)
    var nickname: String = ""

}
val loginPack = LoginPack()

loginPack.userId = "88888"
loginPack.nickname = "飞翔的企鹅"

val encodeJce = loginPack.encodeJce() // == toByteArray()

val decodeJce = encodeJce.decodeJce<LoginPack>()

@飞翔的企鹅 小小企鹅可可爱爱吸洛洛

jce's People

Contributors

o2e avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lingdu57

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.